Package edu.umd.cs.piccolo.util
Class PStack
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
edu.umd.cs.piccolo.util.PStack
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List,RandomAccess
PStack this class should be removed when a non thread safe stack is
added to the java class libraries.
- Version:
- 1.0
- Author:
- Jesse Grosjean
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Constructor Details
-
PStack
public PStack()Creates an empty stack.
-
-
Method Details
-
push
Pushes the provided object onto the top of the stack.- Parameters:
o- object to add to the stack
-
peek
Returns topmost element on the stack, or null if stack is empty.- Returns:
- topmost element on the stack, or null if empty
-
pop
Removes top element on the stack and returns it.- Returns:
- topmost element on stack.
-