ca.odell.glazedlists
Class CollectionList<S,E>
- EventListener, EventList<E>, List, ListEventListener<E>
public class CollectionList<S,E>
A list that acts like a tree in that it contains child elements to nodes contained in
another list. An example usage would be to wrap a parent list containing record albums
and use the CollectionList to display the songs on the album.
The actual mapping from the parent list to the child list (record to songs in the
above example) is done by a
CollectionList.Model
that is provided to the
constructor.
EventList Overview |
Writable: | only set(int,Object) and remove(int) |
Concurrency: | thread ready, not thread safe |
Performance: | reads: O(log N), writes O(log N) |
Memory: | 96 bytes per element |
Unit Tests: | N/A |
Issues: |
96
162
257
265
|
static interface | CollectionList.Model - Provides the logic to map a parent record (e.g., a records album) to its children
(e.g., the songs on the record).
|
int | childEndingIndex(int parentIndex) - Return the index of the last child in the CollectionList for the given parent
index.
|
int | childStartingIndex(int parentIndex) - Return the index of the first child in the CollectionList for the given parent
index.
|
void | dispose()
|
E | get(int index) -
|
void | listChanged(ListEvent listChanges) - Handle changes in the parent list.
|
E | remove(int index) -
|
E | set(int index, E value) -
|
int | size() -
|
add , addAll , clear , dispose , get , getSourceIndex , isWritable , listChanged , remove , removeAll , retainAll , set , size |
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 |
CollectionList
public CollectionList(EventList source,
Model model)
childEndingIndex
public int childEndingIndex(int parentIndex)
Return the index of the last child in the CollectionList for the given parent
index. This can be very useful for things like selecting the children in a
CollectionList when the parent is selected in another list.
childStartingIndex
public int childStartingIndex(int parentIndex)
Return the index of the first child in the CollectionList for the given parent
index. This can be very useful for things like selecting the children in a
CollectionList when the parent is selected in another list.
listChanged
public void listChanged(ListEvent listChanges)
Handle changes in the parent list. We'll need to update our node list sizes.
- listChanged in interface TransformedList<S,E>
Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2008-01-04 14:38