org.jikesrvm.compilers.opt.util
Class Stack<T>
java.lang.Object
org.jikesrvm.compilers.opt.util.Stack<T>
- All Implemented Interfaces:
- Iterable<T>
- Direct Known Subclasses:
- DFSenumerateByFinish, LTDominators, TopSort
public class Stack<T>
- extends Object
- implements Iterable<T>
Stack is a smaller implementation of java.util.Stack, that uses a linked
list rather than a vector.
stack
private final ArrayList<T> stack
Stack
public Stack()
Stack
public Stack(T e)
push
public final T push(T e)
pop
public final T pop()
getTOS
public final T getTOS()
peek
public final T peek()
isEmpty
public final boolean isEmpty()
empty
public final boolean empty()
compare
public final boolean compare(Stack<T> s2)
copy
public final Stack<T> copy()
shallowCopy
public final Stack<T> shallowCopy()
iterator
public final Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
toString
public String toString()
- Overrides:
toString
in class Object