|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.util.SimpleWeakList
danger.util.ActiveObject.WeakDelegateList
public static class ActiveObject.WeakDelegateList
List of delegates which are held onto weakly. Instances of this
class are used to hold multiple delegates that have been added to a
single list instance. onUpdate(danger.util.ActiveObject) calls that same method with
the same argument on each of the delegates in the list. Note that
the SimpleWeakList.add(java.lang.Object) and SimpleWeakList.remove(java.lang.Object) methods are simply the
inherited Object-accepting ones, but the guts of this
class assume that the only things ever added are appropriate
delegates.
| Field Summary | |
|---|---|
protected ActiveObject |
mUpdated
used while iterating |
| Constructor Summary | |
|---|---|
ActiveObject.WeakDelegateList()
Construct an instance with an initial capacity of 4. |
|
ActiveObject.WeakDelegateList(int initialCapacity)
Construct an instance. |
|
| Method Summary | |
|---|---|
protected void |
accept(Object obj)
Method called by SimpleWeakList.accept(Object,Object) in response to a call
to SimpleWeakList.forEachAccept() or SimpleWeakList.forEachAccept(Object). |
ActiveObject.Delegate |
getDelegate(int n)
Get the n delegate, which may turn out to be a
reaped reference. |
void |
onUpdate(ActiveObject obj)
Call onUpdate(danger.util.ActiveObject) on all instances in this list. |
| Methods inherited from class danger.util.SimpleWeakList |
|---|
accept, add, contains, forEachAccept, forEachAccept, get, matchesTarget, remove, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ActiveObject mUpdated
| Constructor Detail |
|---|
public ActiveObject.WeakDelegateList(int initialCapacity)
initialCapacity - initial capacity of the list; it will
expand as neededpublic ActiveObject.WeakDelegateList()
4.
| Method Detail |
|---|
public final ActiveObject.Delegate getDelegate(int n)
n delegate, which may turn out to be a
reaped reference.
n - which delegate to get
nth delegatepublic void onUpdate(ActiveObject obj)
onUpdate(danger.util.ActiveObject) on all instances in this list.
onUpdate in interface ActiveObject.Delegateobj - non-null; the instance which was updatedprotected void accept(Object obj)
SimpleWeakListSimpleWeakList.accept(Object,Object) in response to a call
to SimpleWeakList.forEachAccept() or SimpleWeakList.forEachAccept(Object).
This implementation does
nothing, but subclasses may override it to do something interesting,
if need be.
You should override either this method, or
SimpleWeakList.accept(Object,Object), but not both.
accept in class SimpleWeakListobj - non-null; a live object from the list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||