|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.util.WeakObserverSet<T>
public class WeakObserverSet<T>
Much like WeakObserverList, but provides faster addition and removal in exchange for using additional memory and generating additional garbage (the iterator) on notification.
| Nested Class Summary | |
|---|---|
static interface |
WeakObserverSet.ObserverOp<T>
Instances of this interface are used to apply methods to all observers in a set. |
| Constructor Summary | |
|---|---|
WeakObserverSet()
|
|
| Method Summary | ||
|---|---|---|
boolean |
add(T observer)
Adds an observer to the set. |
|
void |
apply(WeakObserverSet.ObserverOp<T> obop)
Applies the specified operation to all observers in the set. |
|
boolean |
isEmpty()
Checks whether the set is empty. |
|
static
|
newSet()
A convenience method for creating an observer set that avoids duplicating the type parameter on the right hand side. |
|
boolean |
remove(T observer)
Removes an observer from the set. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WeakObserverSet()
| Method Detail |
|---|
public static <T> WeakObserverSet<T> newSet()
public boolean add(T observer)
public boolean remove(T observer)
public boolean isEmpty()
public void apply(WeakObserverSet.ObserverOp<T> obop)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||