E
- Entry typepublic class Stack<E> extends Vector<E>
capacityIncrement, elementCount, elementData
Constructor and Description |
---|
Stack()
Creates an empty Stack.
|
Modifier and Type | Method and Description |
---|---|
boolean |
empty()
Tests if this stack is empty.
|
E |
peek()
Looks at the object at the top of this stack without removing it from the stack.
|
E |
pop()
Removes the object at the top of this stack and returns that object as the value of this function.
|
E |
push(E item)
Pushes an item onto the top of this stack.
|
int |
search(Object obj) |
addElement, capacity, clone, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toString, trimToSize
public boolean empty()
public E peek() throws EmptyStackException
EmptyStackException
- if this stack is empty.public E pop() throws EmptyStackException
EmptyStackException
- if this stack is empty.public E push(E item)
item
- the item to be pushed onto this stack.public int search(Object obj)
obj
- ?