ca.odell.glazedlists

Class CompositeList<E>

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

public class CompositeList<E>
extends CollectionList<S,E>

An EventList composed of multiple source EventLists. This list shows the contents of its source lists.

Note that all contained EventLists must use the same ListEventPublisher and ReadWriteLock, particularly if this EventList is to be used my multiple threads concurrently. To construct an EventList that shares the ListEventPublisher and ReadWriteLock with this CompositeList, use createMemberList().

EventList Overview
Writable:only set(int,Object) and remove(int)
Concurrency:not thread safe
Performance:reads: O(log N), writes O(log N)
Memory:96 bytes per element
Unit Tests:N/A
Issues: 25 93 96 162
Author:
Jesse Wilson

Nested Class Summary

Nested classes/interfaces inherited from class ca.odell.glazedlists.CollectionList<S,E>

CollectionList.Model

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

CompositeList()
CompositeList(ListEventPublisher publisher, ReadWriteLock lock)
Create a CompositeList that uses the given publisher and lock.
CompositeList(ReadWriteLock lock)
Deprecated. replaced by CompositeList(ListEventPublisher,ReadWriteLock), because prebuilt member lists should share lock and publisher with the CompositeList.

Method Summary

void
addMemberList(EventList list)
Adds the specified EventList as a source to this CompositeList.
EventList
createMemberList()
Creates a new EventList that shares its ReadWriteLock with this CompositeList.
void
removeMemberList(EventList list)
Removes the specified EventList as a source EventList to this CompositeList.

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

childEndingIndex, childStartingIndex, dispose, get, listChanged, remove, set, 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

CompositeList

public CompositeList()

CompositeList

public CompositeList(ListEventPublisher publisher,
                     ReadWriteLock lock)
Create a CompositeList that uses the given publisher and lock. Note that this publisher and lock will also be used when building new member lists.

This can be a convenient constructor to use when the member lists are prebuilt ahead of time with a common ListEventPublisher and ReadWriteLock and it is desirable to compose their union with a CompositeList.

Parameters:
publisher - the ListEventPublisher to use within the CompositeList
lock - the ReadWriteLock to use within the CompositeList

CompositeList

public CompositeList(ReadWriteLock lock)

Deprecated. replaced by CompositeList(ListEventPublisher,ReadWriteLock), because prebuilt member lists should share lock and publisher with the CompositeList.

Create a CompositeList that uses the given lock. Note that this lock will also be used when building new member lists.

This can be a convenient constructor to use when the member lists are prebuilt ahead of time with a common ReadWriteLock and it is desirable to compose their union with a CompositeList.

Parameters:
lock - the ReadWriteLock to use within the CompositeList

Method Details

addMemberList

public void addMemberList(EventList list)
Adds the specified EventList as a source to this CompositeList.

To ensure correct behaviour when this CompositeList is used by multiple threads, the specified EventList has to share the same ReadWriteLock and ListEventPublisher with this CompositeList.


createMemberList

public EventList createMemberList()
Creates a new EventList that shares its ReadWriteLock with this CompositeList. This is necessary when this CompositeList will be used by multiple threads.

Note that the created EventList must be explicitly added as a member to this CompositeList using addMemberList(EventList).


removeMemberList

public void removeMemberList(EventList list)

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