T
- The entry typepublic class ListeningCollection<T> extends java.util.AbstractCollection<T>
Modifier and Type | Field and Description |
---|---|
private java.util.List<T> |
base |
private java.lang.Runnable |
runOnModification |
Constructor and Description |
---|
ListeningCollection(java.util.List<T> base,
java.lang.Runnable runOnModification)
Constructs a new
ListeningCollection . |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e) |
protected void |
added(T object)
Called when an object is added.
|
java.util.Iterator<T> |
iterator() |
boolean |
remove(java.lang.Object o) |
protected void |
removed(T object)
Called when an object is removed.
|
int |
size() |
addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final java.lang.Runnable runOnModification
public ListeningCollection(java.util.List<T> base, java.lang.Runnable runOnModification)
ListeningCollection
.base
- base collectionrunOnModification
- runnable run at each modificationpublic final int size()
public final boolean remove(java.lang.Object o)
protected void removed(T object)
object
- the removed object