Class Stack
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<E>
-
- java.util.Stack
-
- org.onemind.commons.java.datastructure.Stack
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,java.util.RandomAccess
public class Stack extends java.util.StackAn extension of java.util.Stack to have popUntil and pushReturnSize method- Version:
- $Id: Stack.java,v 1.2 2004/08/26 12:33:16 thlee Exp $ $Name: $
- Author:
- TiongHiang Lee (thlee@onemindsoft.org)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Stack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpopUntil(int i)Pop until the stack reach size iintpushReturnSize(java.lang.Object o)Push the object ot the stack and return the size before pushing the object in-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
-
-
-
-
Method Detail
-
pushReturnSize
public int pushReturnSize(java.lang.Object o)
Push the object ot the stack and return the size before pushing the object in- Parameters:
o- the object- Returns:
- the size before the push
-
popUntil
public void popUntil(int i)
Pop until the stack reach size i- Parameters:
i- the size
-
-