Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
ca.odell.glazedlists.AbstractEventList<E>
ca.odell.glazedlists.TransformedList<S,E>
ca.odell.glazedlists.CollectionList<S,E>
ca.odell.glazedlists.CompositeList<E>
public class CompositeList<E>
extends CollectionList<S,E>
EventList
composed of multiple source EventList
s. This list
shows the contents of its source lists.
Note that all contained EventList
s 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()
.
Warning: This class is
thread ready but not thread safe. See EventList
for an example
of thread safe code.
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 |
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 | |
| |
|
Method Summary | |
|
|
void |
|
void |
|
Methods inherited from class ca.odell.glazedlists.CollectionList<S,E> | |
childEndingIndex , childStartingIndex , dispose , get , isWritable , 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 |
public CompositeList()
public CompositeList(ListEventPublisher publisher, ReadWriteLock lock)
Create aCompositeList
that uses the givenpublisher
andlock
. Note that this publisher and lock will also be used whenbuilding new member lists
. This can be a convenient constructor to use when the member lists are prebuilt ahead of time with a commonListEventPublisher
andReadWriteLock
and it is desirable to compose their union with aCompositeList
.
- Parameters:
publisher
- theListEventPublisher
to use within theCompositeList
lock
- theReadWriteLock
to use within theCompositeList
public CompositeList(ReadWriteLock lock)
Deprecated. replaced by
CompositeList(ListEventPublisher,ReadWriteLock)
, because prebuilt member lists should share lock and publisher with the CompositeList.Create aCompositeList
that uses the givenlock
. Note that this lock will also be used whenbuilding new member lists
. This can be a convenient constructor to use when the member lists are prebuilt ahead of time with a commonReadWriteLock
and it is desirable to compose their union with aCompositeList
.
- Parameters:
lock
- theReadWriteLock
to use within theCompositeList
publicEventList createMemberList()
Creates a newEventList
that shares itsReadWriteLock
with thisCompositeList
. This is necessary when thisCompositeList
will be used by multiple threads. Note that the createdEventList
must be explicitly added as a member to thisCompositeList
usingaddMemberList(EventList)
.
public void addMemberList(EventListlist)
Adds the specifiedEventList
as a source to thisCompositeList
. To ensure correct behaviour when thisCompositeList
is used by multiple threads, the specified EventList has to share the sameReadWriteLock
andListEventPublisher
with this CompositeList.
- See Also:
createMemberList()
public void removeMemberList(EventListlist)