|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ActiveList<T>
A list of items that has hooks for notification of updates. Notification
happens via the ActiveList.Delegate. Also, particular
implementations of this interface may provide other means of
notification. This interface only defines methods for accessing, not
modifying, the list; however, particular implementations of this interface
generally provide a means of modification.
| Nested Class Summary | |
|---|---|
static interface |
ActiveList.Delegate<T>
Interface for delegates that get notified on changes to instances of ActiveList. |
static interface |
ActiveList.ForEach<T>
Callback interface used for calls to forEach(danger.util.ActiveList.ForEach). |
static class |
ActiveList.WeakDelegateList
List of delegates which are held onto weakly. |
| Method Summary | |
|---|---|
void |
addDelegate(ActiveList.Delegate<T> delegate)
Add a new delegate to this instance. |
int |
eqIndexOf(T item)
Get the index of the given item in the list, compared with ==. |
void |
forEach(ActiveList.ForEach callback)
Call the given callback on each of the items in this list, in order. |
T |
getItem(int which)
Get the nth item in this list. |
void |
getItems(int srcBegin,
int srcEnd,
T[] dest,
int destBegin)
Get a range of items atomically with respect to other operations on this instance. |
void |
removeDelegate(ActiveList.Delegate<T> delegate)
Remove a delegate from this instance that was previously added via a call to addDelegate(danger.util.ActiveList.Delegate. |
int |
size()
Get the number of items in this list. |
| Method Detail |
|---|
void addDelegate(ActiveList.Delegate<T> delegate)
delegate - non-null; the delegate to add
NullPointerException - thrown if delegate == nullvoid removeDelegate(ActiveList.Delegate<T> delegate)
addDelegate(danger.util.ActiveList.Delegate) .
delegate - non-null; the delegate to remove
IllegalArgumentException - thrown if the delegate
had not been added as a delegate of this instanceint size()
T getItem(int which)
nth item in this list.
which - >= 0 && < size(); which item to get
nth item
void getItems(int srcBegin,
int srcEnd,
T[] dest,
int destBegin)
srcBegin - >= 0; the first item to getsrcEnd - >= srcBegin && <= size(); the index just
past the last item to getdest - non-null; the destination bufferdestBegin - >= 0 && <= (dest.length - (srcEnd -
srcBegin)); where in dest to store the items
NullPointerException - thrown if dest == null
IndexOutOfBoundsException - thrown if any of the indices
is badvoid forEach(ActiveList.ForEach callback)
callback - non-null; the callback objectint eqIndexOf(T item)
==.
item - null-ok; the item to look for
-1 if there
is no such item
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||