|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ActiveList
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
Interface for delegates that get notified on changes to instances of ActiveList. |
static interface |
ActiveList.ForEach
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 delegate)
Add a new delegate to this instance. |
int |
eqIndexOf(Object 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. |
Object |
getItem(int which)
Get the nth item in this list. |
void |
getItems(int srcBegin,
int srcEnd,
Object[] dest,
int destBegin)
Get a range of items atomically with respect to other operations on this instance. |
void |
removeDelegate(ActiveList.Delegate 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 delegate)
delegate - non-null; the delegate to add
NullPointerException - thrown if delegate == nullvoid removeDelegate(ActiveList.Delegate 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()
Object getItem(int which)
nth item in this list.
which - >= 0 && < size(); which item to get
nth item
void getItems(int srcBegin,
int srcEnd,
Object[] 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(Object 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 | |||||||||