|
FlexDoc/Javadoc 2.0 Demo Java Doc |
When a stack is first created, it contains no items.
A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class. For example:
Deque<Integer> stack = new ArrayDeque<Integer>();
Field Summary |
Fields inherited from class java.util.Vector |
Fields inherited from class java.util.AbstractList |
Constructor Summary |
||
Stack()
Creates an empty Stack.
|
Method Summary |
||
boolean |
empty()
Tests if this stack is empty.
|
|
peek()
Looks at the object at the top of this stack without removing it
from the stack.
|
||
pop()
Removes the object at the top of this stack and returns that
object as the value of this function.
|
||
Pushes an item onto the top of this stack.
|
||
int |
Returns the 1-based position where an object is on this stack.
|
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.lang.Object |
Methods inherited from interface java.util.Collection |
Methods inherited from interface java.util.List |
public Stack |
() |
public E push |
(E item) |
addElement(item)
public E pop |
() |
public E peek |
() |
public boolean empty |
() |
public int search |
(Object o) |
|
FlexDoc/Javadoc 2.0 Demo Java Doc |