|
LimeWire Collection Component API | |||||||||
| 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<E,E>
org.limewire.collection.glazedlists.PluggableList<E>
public class PluggableList<E>
An EventList which delegates all List methods to a given source
EventList that may be replaced at runtime using
setSource(EventList).
Note that the source EventList 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
PluggableList, use createSourceList().
Warning: This class is
thread ready but not thread safe. See EventList for an example
of thread safe code.
| EventList Overview | |
| Writable: | yes |
| Concurrency: | only setSource(EventList) |
| Performance: | delegates to source EventList |
| Memory: | N/A |
| Unit Tests: | N/A |
| Issues: | |
| Field Summary |
|---|
| Fields inherited from class ca.odell.glazedlists.TransformedList |
|---|
source |
| Fields inherited from class ca.odell.glazedlists.AbstractEventList |
|---|
publisher, readWriteLock, updates |
| Constructor Summary | |
|---|---|
PluggableList(ca.odell.glazedlists.EventList<E> source)
Constructs a PluggableList which delegates all List methods to the given source. |
|
PluggableList(ca.odell.glazedlists.event.ListEventPublisher publisher,
ca.odell.glazedlists.util.concurrent.ReadWriteLock lock)
Constructs a PluggableList which delegates all List methods to a given source. |
|
| Method Summary | |
|---|---|
ca.odell.glazedlists.EventList<E> |
createSourceList()
Creates a new EventList that shares its
ReadWriteLock and
ListEventPublisher with this
PluggableList. |
void |
dispose()
|
protected boolean |
isWritable()
|
void |
listChanged(ca.odell.glazedlists.event.ListEvent<E> listChanges)
|
void |
setSource(ca.odell.glazedlists.EventList<E> source)
Sets the source EventList to which this PluggableList will delegate all calls. |
| Methods inherited from class ca.odell.glazedlists.TransformedList |
|---|
add, addAll, clear, get, getSourceIndex, remove, removeAll, retainAll, set, size |
| 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 PluggableList(ca.odell.glazedlists.event.ListEventPublisher publisher,
ca.odell.glazedlists.util.concurrent.ReadWriteLock lock)
source. The source EventList may be replaced using
setSource(EventList) and this PluggableList will produce a
ListEvent describing the change in data.
public PluggableList(ca.odell.glazedlists.EventList<E> source)
source. At some future time, the source EventList may be
replaced using setSource(EventList) and this PluggableList will
produce a ListEvent describing the change in data.
source - the source of data to this PluggableList| Method Detail |
|---|
public ca.odell.glazedlists.EventList<E> createSourceList()
EventList that shares its
ReadWriteLock and
ListEventPublisher with this
PluggableList. This is necessary when this PluggableList
will be used by multiple threads.
Note that the created EventList must be explicitly set as the
source of this PluggableList using setSource(EventList).
source of this PluggableListpublic void setSource(ca.odell.glazedlists.EventList<E> source)
To ensure correct behaviour when this PluggableList is used by
multiple threads, the given source must
share the same ReadWriteLock and
ListEventPublisher with this PluggableList.
source - the new source of data for this PluggableList, and all
downstream EventListsprotected boolean isWritable()
isWritable in class ca.odell.glazedlists.TransformedList<E,E>public void listChanged(ca.odell.glazedlists.event.ListEvent<E> listChanges)
listChanged in interface ca.odell.glazedlists.event.ListEventListener<E>listChanged in class ca.odell.glazedlists.TransformedList<E,E>public void dispose()
dispose in class ca.odell.glazedlists.TransformedList<E,E>
|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||