|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.base.glazedlists.AbstractEventList<E> com.levigo.util.base.glazedlists.TransformedList<S,E> com.levigo.util.base.glazedlists.CollectionList<EventList<E>,E> com.levigo.util.base.glazedlists.CompositeList<E>
public class CompositeList<E>
An 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 CollectionList.set(int,Object) and CollectionList.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 com.levigo.util.base.glazedlists.CollectionList |
---|
CollectionList.Model<E,S> |
Field Summary |
---|
Fields inherited from class com.levigo.util.base.glazedlists.TransformedList |
---|
source |
Fields inherited from class com.levigo.util.base.glazedlists.AbstractEventList |
---|
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<E> list)
Adds the specified EventList as a source to this CompositeList . |
|
|
createMemberList()
Creates a new EventList that shares its ReadWriteLock with
this CompositeList . |
|
void |
removeMemberList(EventList<E> list)
Removes the specified EventList as a source EventList
to this CompositeList . |
Methods inherited from class com.levigo.util.base.glazedlists.CollectionList |
---|
childEndingIndex, childStartingIndex, dispose, get, isWritable, listChanged, remove, set, size |
Methods inherited from class com.levigo.util.base.glazedlists.TransformedList |
---|
add, addAll, clear, getSourceIndex, removeAll, retainAll |
Methods inherited from class com.levigo.util.base.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 CompositeList()
@Deprecated public CompositeList(ReadWriteLock lock)
CompositeList(ListEventPublisher, ReadWriteLock)
, because
prebuilt member lists should share lock and publisher with the
CompositeList.
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
.
lock
- the ReadWriteLock
to use within the CompositeList
public CompositeList(ListEventPublisher publisher, ReadWriteLock lock)
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
.
publisher
- the ListEventPublisher
to use within the CompositeList
lock
- the ReadWriteLock
to use within the CompositeList
Method Detail |
---|
public void addMemberList(EventList<E> list)
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.
IllegalArgumentException
- if the specified EventList uses a different
ReadWriteLock
or ListEventPublisher
createMemberList()
public <E> EventList<E> createMemberList()
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)
.
public void removeMemberList(EventList<E> list)
EventList
as a source EventList
to this CompositeList
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |