|
||||||||||
| 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<S,E>
ca.odell.glazedlists.CollectionList<S,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 |
CollectionList.Model| Nested Class Summary | |
|---|---|
static interface |
CollectionList.Model<E,S>
Provides the logic to map a parent record (e.g., a records album) to its children (e.g., the songs on the record). |
| Field Summary |
|---|
| Fields inherited from class ca.odell.glazedlists.TransformedList |
|---|
source |
| Fields inherited from class ca.odell.glazedlists.AbstractEventList |
|---|
publisher, readWriteLock, updates |
| Constructor Summary | |
|---|---|
CollectionList(EventList<S> source,
CollectionList.Model<S,E> model)
Create a CollectionList that's contents will be the children of the
elements in the specified source EventList. |
|
| Method Summary | |
|---|---|
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. |
E |
get(int index)
Returns the element at the specified position in this list. |
void |
listChanged(ListEvent<S> listChanges)
Handle changes in the parent list. |
E |
remove(int index)
Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. |
E |
set(int index,
E value)
Replaces the element at the specified position in this list with the specified element (optional operation). |
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, getSourceIndex, isWritable, removeAll, retainAll |
| 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 CollectionList(EventList<S> source,
CollectionList.Model<S,E> model)
CollectionList that's contents will be the children of the
elements in the specified source EventList.
| Method Detail |
|---|
public int size()
size in interface Collection<E>size in interface List<E>size in class TransformedList<S,E>public E get(int index)
get in interface List<E>get in class TransformedList<S,E>index - index of element to return.
public E set(int index,
E value)
set in interface List<E>set in class TransformedList<S,E>index - index of element to replace.value - element to be stored at the specified position.
public E remove(int index)
remove in interface List<E>remove in class TransformedList<S,E>index - the index of the element to removed.
public int childStartingIndex(int parentIndex)
childEndingIndex(int)public int childEndingIndex(int parentIndex)
childStartingIndex(int)public void listChanged(ListEvent<S> listChanges)
listChanged in interface ListEventListener<S>listChanged in class TransformedList<S,E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||