Package coneforest.psylla
Class Stack<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
coneforest.psylla.Stack<E>
- Type Parameters:
E
- a type of an element.
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
- Direct Known Subclasses:
DictStack
,ExecutionStack
,OperandStack
,ProcStack
Base class for interpreter’s stacks.
- See Also:
-
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, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
Stack
public Stack()
-
-
Method Details
-
pop
Pops and returns the last element of the stack.- Returns:
- an element popped.
-
peek
Returns the last element of the stack without popping it.- Returns:
- an element.
-
push
Pushes an element to the stack.- Parameters:
element
- an element.
-
setSize
public void setSize(int size)
-