ca.odell.glazedlists

Class CollectionList<S,E>

Implemented Interfaces:
EventListener, EventList<E>, List, ListEventListener<E>
Known Direct Subclasses:
CompositeList<E>

public class CollectionList<S,E>
extends TransformedList<S,E>
implements ListEventListener<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
Authors:
Rob Eden
Jesse Wilson
See Also:
CollectionList.Model

Nested Class Summary

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).

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

CollectionList(EventList source, Model model)
Create a CollectionList with its contents being 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.
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()

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

CollectionList

public CollectionList(EventList source,
                      Model model)
Create a CollectionList with its contents being the children of the elements in the specified source EventList.

Method Details


Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2008-01-04 14:38