java.lang.Object
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<PsyObject>,Collection<PsyObject>,List<PsyObject>,RandomAccess,SequencedCollection<PsyObject>
An interpreter’s operand stack.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclone()voidensureSize(int size) Ensures that the operand stack is at least the given size.booleanintReturns the position of the topmostmarkobject on the operand stack.<T extends PsyObject>
TgetBacked(int index) inthashCode()voidpopOperands(int count) voidpushOptional(Optional<? extends PsyObject> opt) voidrollback()Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
OperandStack
public OperandStack()
-
-
Method Details
-
getBacked
-
clearBackup
public void clearBackup() -
ensureSize
Ensures that the operand stack is at least the given size.- Parameters:
size- the given size.- Throws:
PsyStackUnderflowException- when the operand stack’s size less than the given size.
-
popOperands
- Throws:
PsyStackUnderflowException
-
rollback
public void rollback() -
findMarkPosition
Returns the position of the topmostmarkobject on the operand stack.- Returns:
- the position of the topmost
markobject on the operand stack - Throws:
PsyUnmatchedMarkException- if there is nomarkobject on the operand stack.
-
pushOptional
-
equals
-
hashCode
public int hashCode() -
clone
-