| |
|
| java.lang.Object com.tc.util.Stack
Stack | public class Stack (Code) | | |
Constructor Summary | |
public | Stack() Creates an empty Stack. |
Method Summary | |
public boolean | contains(Object o) | public boolean | empty() Tests if this stack is empty. | public Object | get(int index) | public boolean | isEmpty() | public Iterator | iterator() | public Object | peek() Looks at the object at the top of this stack without removing it from the stack. | public Object | pop() Removes the object at the top of this stack and returns that object as the value of this function. | public Object | push(Object item) Pushes an item onto the top of this stack. | public Object | remove(int index) | public boolean | remove(Object o) | public int | search(Object o) Returns the 1-based position where an object is on this stack. | public int | size() |
Stack | public Stack()(Code) | | Creates an empty Stack.
|
empty | public boolean empty()(Code) | | Tests if this stack is empty.
true if and only if this stack contains no items; false otherwise. |
isEmpty | public boolean isEmpty()(Code) | | |
peek | public Object peek()(Code) | | Looks at the object at the top of this stack without removing it from the stack.
the object at the top of this stack (the last item of the Vector object). exception: EmptyStackException - if this stack is empty. |
pop | public Object pop()(Code) | | Removes the object at the top of this stack and returns that object as the value of this function.
The object at the top of this stack (the last item of the Vector object). exception: EmptyStackException - if this stack is empty. |
push | public Object push(Object item)(Code) | | Pushes an item onto the top of this stack. This has exactly the same effect as:
Parameters: item - the item to be pushed onto this stack. the item argument. See Also: java.util.Vector.addElement |
search | public int search(Object o)(Code) | | Returns the 1-based position where an object is on this stack. If the object o occurs as an item in this
stack, this method returns the distance from the top of the stack of the occurrence nearest the top of the stack;
the topmost item on the stack is considered to be at distance 1. The equals method is used
to compare o to the items in this stack.
Parameters: o - the desired object. the 1-based position from the top of the stack where the object is located; the return value-1 indicates that the object is not on the stack. |
size | public int size()(Code) | | Size of this Stack
the size of the stack |
|
|
|