|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<T> scale.common.Vector<T> scale.common.Stack<T>
public class Stack<T>
Implement our own Stack class that is un-synchronized and allows us to collect statictics on the number of Stacks in use.
$Id: Stack.java,v 1.4 2007-10-04 19:58:11 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
Stack()
Constructs an empty vector. |
|
Stack(int initialCapacity)
Constructs an empty vector with the specified initial capacity. |
|
Stack(int initialCapacity,
int dummy)
Constructs an empty vector with the specified initial capacity. |
|
Stack(Stack<T> stk)
Constructs an empty vector. |
Method Summary | |
---|---|
Stack<T> |
clone()
Returns a clone of this vector. |
boolean |
empty()
Returns true if and only if this stack contains no items; false otherwise. |
T |
peek()
Returns the object at the top of this stack without removing it from the stack. |
T |
peekd()
Returns the object next to the top of this stack without removing it from the stack. |
T |
pop()
Removes the object at the top of this stack and returns that object as the value of this function. |
T |
push(T element)
Pushes an item onto the top of this stack. |
int |
search(java.lang.Object o)
Returns the 1-based position where an object is on this stack. |
Methods inherited from class scale.common.Vector |
---|
addElement, addVectors, addVectors, addVectors, elementAt, elements, firstElement, insertElementAt, lastElement, removeAllElements, removeElement, removeElementAt, reverse, setElementAt, setSize |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, 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(int initialCapacity)
initialCapacity
- the initial capacity of the vector.public Stack(int initialCapacity, int dummy)
initialCapacity
- the initial capacity of the vector.public Stack()
public Stack(Stack<T> stk)
Method Detail |
---|
public Stack<T> clone()
clone
in class Vector<T>
public T pop()
public T push(T element)
public T peek()
public T peekd()
public final boolean empty()
public final int search(java.lang.Object o)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |