org.jikesrvm.compilers.opt.util
Class Stack<T>

java.lang.Object
  extended by 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.


Field Summary
private  ArrayList<T> stack
           
 
Constructor Summary
Stack()
           
Stack(T e)
           
 
Method Summary
 boolean compare(Stack<T> s2)
           
 Stack<T> copy()
           
 boolean empty()
           
 T getTOS()
           
 boolean isEmpty()
           
 Iterator<T> iterator()
           
 T peek()
           
 T pop()
           
 T push(T e)
           
 Stack<T> shallowCopy()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stack

private final ArrayList<T> stack
Constructor Detail

Stack

public Stack()

Stack

public Stack(T e)
Method Detail

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