public class SimpleStack
extends java.util.ArrayList
Constructor and Description |
---|
SimpleStack()
Constructs an empty list.
|
SimpleStack(java.util.Collection c)
Constructs a stack containing the elements of the specified
collection, pushed in the order they are returned by the
collection's iterator.
|
SimpleStack(int initialCapacity)
Constructs an empty stack with the specified initial capacity.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
peek()
Retrieves the object at the top of the stack without removing it.
|
java.lang.Object |
pop()
Pops the object off the top of the stack.
|
void |
push(java.lang.Object o)
Pushes the object onto the top of the stack by appending it to
the end of this list.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
public SimpleStack()
public SimpleStack(java.util.Collection c)
public SimpleStack(int initialCapacity)
public java.lang.Object pop()
public void push(java.lang.Object o)
o
- the Object to be pushed.public java.lang.Object peek()