|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A dispenser, see [Meyer1997], is a Strategy, see [Gamma1995], that decides the order in which elements governed by the dispenser will be processed. Some well known strategies are:
Method Summary | |
boolean |
isEmpty()
return size() == 0; |
boolean |
notEmpty()
return !isEmpty(); |
java.lang.Object |
pop()
Chooses the next element to be processed, removes it from the dispenser, and returns the element. |
void |
push(java.lang.Object element)
Adds a new element into the dispenser. |
void |
pushAll(java.util.Collection c)
Adds all elements in the collection into the dispenser in the order that the iterator of the collection returns them. |
void |
pushAll(java.util.Iterator i)
Adds all elements returned by the iterator into the dispenser in the order that the iterator returns them. |
void |
pushAllRight(java.util.List l)
Adds all elements in the list into the dispenser starting from the last element in the list. |
int |
size()
Number of elements in the dispenser. |
Method Detail |
public boolean isEmpty()
return size() == 0;
public boolean notEmpty()
return !isEmpty();
public int size()
Number of elements in the dispenser.
public java.lang.Object pop()
Chooses the next element to be processed, removes it from the dispenser, and returns the element.
public void push(java.lang.Object element)
Adds a new element into the dispenser.
public void pushAll(java.util.Collection c)
Adds all elements in the collection into the dispenser in the order that the iterator of the collection returns them.
public void pushAll(java.util.Iterator i)
Adds all elements returned by the iterator into the dispenser in the order that the iterator returns them.
public void pushAllRight(java.util.List l)
Adds all elements in the list into the dispenser starting from the last element in the list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |