| java.lang.Object org.griphyn.vdl.router.ListStack
ListStack | public class ListStack (Code) | | This class maintains a stack of classes that implement the
java.util.List interface.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision $ |
Constructor Summary | |
public | ListStack() C'tor: Creates a new stack instance that is empty. |
Method Summary | |
public List | at(int index) Accessor to a definition at a certain position. | public List | flatten() Flattens all vectors in the stack into one, starting with the
bottom-most vector. | public boolean | isEmpty() Accessor predicate: Determines, if the stack contains any elements. | public List | pop() Removes the tos, thus makeing the next-lower vector the tos. | public void | push(List item) Pushes a new bunch of things onto the stack. | public int | size() Accessor: Determines the number of elements in the stack. | public List | tos() Accessor: Grants access to the top of stack (tos) element. |
ListStack | public ListStack()(Code) | | C'tor: Creates a new stack instance that is empty.
|
at | public List at(int index)(Code) | | Accessor to a definition at a certain position. This method is
susceptible to exception thrown by the List for
inaccessible positions.
List at a given position in the stack. |
flatten | public List flatten()(Code) | | Flattens all vectors in the stack into one, starting with the
bottom-most vector.
List containing all vectors, may be empty. |
isEmpty | public boolean isEmpty()(Code) | | Accessor predicate: Determines, if the stack contains any elements.
true, if the stack is empty, false otherwise. |
pop | public List pop()(Code) | | Removes the tos, thus makeing the next-lower vector the tos.
the old top-of-stack. throws: EmptyStackException - if the stack did not have any elements. |
push | public void push(List item)(Code) | | Pushes a new bunch of things onto the stack.
Parameters: item - is the new List to become new top-of-stack. |
size | public int size()(Code) | | Accessor: Determines the number of elements in the stack.
number of elements, or 0 for an empty stack. |
tos | public List tos()(Code) | | Accessor: Grants access to the top of stack (tos) element.
the current top of stack vector. throws: EmptyStackException - if the stack is empty. |
|
|