public class Stack4D<T>
extends java.util.Vector<T>
Constructor and Description |
---|
Stack4D()
This constructor creates a new Stack, initially empty
|
Modifier and Type | Method and Description |
---|---|
boolean |
empty()
Tests if the stack is empty.
|
T |
peek()
Returns the top Object on the stack without removing it.
|
T |
pop()
Pops an item from the stack and returns it.
|
T |
push(T item)
Pushes an Object onto the top of the stack.
|
int |
search(java.lang.Object o)
Returns the position of an Object on the stack, with the top
most Object being at position 1, and each Object deeper in the
stack at depth + 1.
|
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
public T push(T item)
item
- the Object to push onto the stackVector.addElement(Object)
public T pop()
java.util.EmptyStackException
- if the stack is emptypublic T peek()
java.util.EmptyStackException
- if the stack is emptypublic boolean empty()
public int search(java.lang.Object o)
o
- The object to search for