|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
java.util.Stack<E>
public class Stack<E>
Stack is a Last-In/First-Out(LIFO) data structure which
represents a stack of objects. It enables users to pop and push onto the
stack, including null objects. There is no limit to the size of the stack
| Field Summary |
|---|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
Stack()
Constructs a stack with the default size of Vector. |
|
| Method Summary | |
|---|---|
boolean |
empty()
Determines if the stack is empty or not. |
E |
peek()
Returns the element at the top of the stack without removing it. |
E |
pop()
Returns the element at the top of the stack and removes it. |
E |
push(E object)
Pushes the object from the parameter onto the top of the stack. |
int |
search(Object o)
Returns the index of the first occurrence of the object. |
| Methods inherited from class java.util.Vector |
|---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Constructor Detail |
|---|
public Stack()
Vector.
| Method Detail |
|---|
public boolean empty()
public E peek()
EmptyStackException - when empty() is truepop()public E pop()
EmptyStackException - when empty() is truepeek(),
push(E)public E push(E object)
object - The object to be added to the stack
peek(),
pop()public int search(Object o)
o - the object to be searched
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||