|
Parsing Engine | |||||||||
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.ArrayList
danbikel.util.Stack
public class Stack
A simple stack implementation created from an ArrayList
.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
Stack()
Constructs an empty stack. |
|
Stack(Collection c)
Constructs a stack with the specified collection, whose bottom element is the first returned by c.iterator() and
whose top element is the last. |
|
Stack(int initialCapacity)
Constructs a stack with the specified initial capacity. |
Method Summary | |
---|---|
boolean |
empty()
Returns true if this stack contains no elements. |
Object |
pop()
Pops the top element off the stack. |
void |
push(Object obj)
Pushes the specified object onto the stack. |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public Stack()
public Stack(Collection c)
c.iterator()
and
whose top element is the last.
public Stack(int initialCapacity)
Method Detail |
---|
public boolean empty()
true
if this stack contains no elements.
public void push(Object obj)
public Object pop()
IndexOutOfBoundsException
- if this stack was empty prior
to calling this method
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |