|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.odell.glazedlists.AbstractEventList<E>
ca.odell.glazedlists.TransformedList<E,E>
ca.odell.glazedlists.SeparatorList<E>
public class SeparatorList<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.
| Nested Class Summary | |
|---|---|
static interface |
SeparatorList.Separator<E>
A separator heading the elements of a group. |
| Field Summary |
|---|
| Fields inherited from class ca.odell.glazedlists.TransformedList |
|---|
source |
| Fields inherited from class ca.odell.glazedlists.AbstractEventList |
|---|
publisher, readWriteLock, updates |
| Constructor Summary | |
|---|---|
SeparatorList(EventList<E> source,
Comparator<E> comparator,
int minimumSizeForSeparator,
int defaultLimit)
Create a SeparatorList... |
|
| Method Summary | |
|---|---|
protected int |
getSourceIndex(int mutationIndex)
Gets the index in the source EventList that corresponds to the
specified index. |
void |
listChanged(ListEvent<E> listChanges)
When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary. It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event. |
void |
setComparator(Comparator<E> comparator)
Set the Comparator used to determine how elements are split
into groups. |
int |
size()
Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE. |
| Methods inherited from class ca.odell.glazedlists.TransformedList |
|---|
add, addAll, clear, dispose, get, isWritable, remove, removeAll, retainAll, set |
| Methods inherited from class ca.odell.glazedlists.AbstractEventList |
|---|
add, addAll, addListEventListener, contains, containsAll, equals, getPublisher, getReadWriteLock, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeListEventListener, subList, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SeparatorList(EventList<E> source,
Comparator<E> comparator,
int minimumSizeForSeparator,
int defaultLimit)
SeparatorList...
| Method Detail |
|---|
public int size()
size in interface Collection<E>size in interface List<E>size in class TransformedList<E,E>protected int getSourceIndex(int mutationIndex)
EventList that corresponds to the
specified index. More formally, returns the index such that
this.get(i) == source.get(getSourceIndex(i)) for all
legal values of i.
getSourceIndex in class TransformedList<E,E>public void setComparator(Comparator<E> comparator)
Comparator used to determine how elements are split
into groups.
Performance Note: sorting will take O(N * Log N) time.
Warning: This method is
thread ready but not thread safe. See EventList for an example
of thread safe code.
public void listChanged(ListEvent<E> listChanges)
It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.
listChanged in interface ListEventListener<E>listChanged in class TransformedList<E,E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||