|
||||||||||
| 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
ca.odell.glazedlists.migrationkit.AbstractFilterList
filterMatches(Object) with a Matcher or
MatcherEditor, logic can be reused. That approach is far more flexible
and powerful than the static filtering required by AbstractFilterList.
public abstract class AbstractFilterList
An EventList that shows a subset of the elements of a source
EventList. This subset is composed of all elements of the source
EventList that match the filter.
The filter can be static or dynamic. Changing the behaviour of the filter will change which elements of the source list are included.
Extending classes define the filter by implementing the method
filterMatches(Object).
Extending classes must call handleFilterChanged() when the filter
has changed in order to update the subset of included elements. This method
must also be called at the end of the extending class's constructor.
Warning: This class
breaks the contract required by List. See EventList
for an example.
| EventList Overview | |
| Writable: | yes |
| Concurrency: | thread ready, not thread safe |
| Performance: | reads: O(log N), writes O(log N), filter changes O(N) |
| Memory: | 0 to 26 bytes per element |
| Unit Tests: | N/A |
| Issues: | N/A |
| Field Summary |
|---|
| Fields inherited from class ca.odell.glazedlists.TransformedList |
|---|
source |
| Fields inherited from class ca.odell.glazedlists.AbstractEventList |
|---|
publisher, readWriteLock, updates |
| Constructor Summary | |
|---|---|
protected |
AbstractFilterList(EventList source)
Deprecated. Creates a AbstractFilterList that includes a subset of the specified
source EventList. |
| Method Summary | |
|---|---|
void |
dispose()
Deprecated. Releases the resources consumed by this TransformedList so that it
may eventually be garbage collected. |
abstract boolean |
filterMatches(Object element)
Deprecated. Tests if the specified item from the source EventList is matched by
the current filter. |
protected void |
handleFilterChanged()
Deprecated. Handles changes to the behavior of the filter. |
protected void |
handleFilterCleared()
Deprecated. Handles a clearing of the filter. |
protected void |
handleFilterConstrained()
Deprecated. Handles a constraining or narrowing of the filter. |
protected void |
handleFilterRelaxed()
Deprecated. Handles a relaxing or widening of the filter. |
protected boolean |
isWritable()
Deprecated. Gets whether the source EventList is writable via this API. |
void |
listChanged(ListEvent listChanges)
Deprecated. When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary. It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event. |
| 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 |
|---|
protected AbstractFilterList(EventList source)
AbstractFilterList that includes a subset of the specified
source EventList.
Extending classes must call handleFilterChanged().
| Method Detail |
|---|
protected void handleFilterCleared()
protected final void handleFilterRelaxed()
EventList as filtered elements are unfiltered
due to the relaxation of the filter.
Warning: This method is
thread ready but not thread safe. See EventList for an example
of thread safe code.
protected final void handleFilterConstrained()
EventList as elements are further filtered due
to the constraining of the filter.
Warning: This method is
thread ready but not thread safe. See EventList for an example
of thread safe code.
protected final void handleFilterChanged()
EventList as elements are filtered and unfiltered.
Warning: This method is
thread ready but not thread safe. See EventList for an example
of thread safe code.
public abstract boolean filterMatches(Object element)
EventList is matched by
the current filter.
EventList or false for elements that
shall not be included in this EventList.public void listChanged(ListEvent listChanges)
It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.
listChanged in interface ListEventListenerlistChanged in class TransformedListprotected boolean isWritable()
EventList is writable via this API.
Extending classes must override this method in order to make themselves writable.
isWritable in class TransformedListpublic void dispose()
TransformedList so that it
may eventually be garbage collected.
A TransformedList will be garbage collected without a call to
TransformedList.dispose(), but not before its source EventList is garbage
collected. By calling TransformedList.dispose(), you allow the TransformedList
to be garbage collected before its source EventList. This is
necessary for situations where a TransformedList is short-lived but
its source EventList is long-lived.
Warning: It is an error
to call any method on a TransformedList after it has been disposed.
dispose in class TransformedList
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||