ca.odell.glazedlists

Class SeparatorList<E>

Implemented Interfaces:
EventListener, EventList<E>, List, ListEventListener<E>

public class SeparatorList<E>
extends TransformedList<S,E>

A list that adds separator objects before each group of elements.

Warning: this class won't work very well with generics because separators are mixed in, which will be a different class than the other list elements.

Developer Preview this class is still under heavy development and subject to API changes. It's also really slow at the moment and won't scale to lists of size larger than a hundred or so efficiently.

Author:
Jesse Wilson

Nested Class Summary

static interface
SeparatorList.Separator
A separator heading the elements of a group.

Field Summary

Fields inherited from class ca.odell.glazedlists.TransformedList<S,E>

source

Fields inherited from class ca.odell.glazedlists.AbstractEventList<E>

publisher, readWriteLock, updates

Constructor Summary

SeparatorList(EventList source, Comparator comparator, int minimumSizeForSeparator, int defaultLimit)
Create a SeparatorList...

Method Summary

protected int
getSourceIndex(int mutationIndex)
void
listChanged(ListEvent listChanges)
void
setComparator(Comparator comparator)
Set the Comparator used to determine how elements are split into groups.
int
size()

Methods inherited from class ca.odell.glazedlists.TransformedList<S,E>

add, addAll, clear, dispose, get, getSourceIndex, isWritable, listChanged, remove, removeAll, retainAll, set, size

Methods inherited from class ca.odell.glazedlists.AbstractEventList<E>

T[] toArray, add, add, addAll, addAll, addListEventListener, clear, contains, containsAll, equals, get, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeListEventListener, retainAll, set, size, subList, toArray, toString

Constructor Details

SeparatorList

public SeparatorList(EventList source,
                     Comparator comparator,
                     int minimumSizeForSeparator,
                     int defaultLimit)

Method Details

getSourceIndex

protected int getSourceIndex(int mutationIndex)
Overrides:
getSourceIndex in interface TransformedList<S,E>

listChanged

public void listChanged(ListEvent listChanges)
Specified by:
listChanged in interface ListEventListener<E>

setComparator

public void setComparator(Comparator comparator)

size

public int size()
Overrides:
size in interface TransformedList<S,E>

Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by pbuilder at 2007-12-21 23:49