Class DictStack
java.lang.Object
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<PsyFormalDict<PsyObject>>, Collection<PsyFormalDict<PsyObject>>, List<PsyFormalDict<PsyObject>>, RandomAccess, SequencedCollection<PsyFormalDict<PsyObject>>
An interpreter’s dictionary stack.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dictionary stack with two permanent dictionaries in it (system and user dictionaries). -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin(PsyFormalDict<PsyObject> oDict) Pushes the dictionary to this stack.clone()voidend()Pops a non-permanent dictionary from this stack.<T extends PsyObject>
TPerforms in-depth search for the givenstringkey in this stack and returns the associated value.<T extends PsyObject>
TPerforms in-depth search for the given key in this stack and returns the associated value.voidstore(PsyTextual oKey, PsyObject oValue) Methods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, 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 AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Constructor Details
-
DictStack
Creates a new dictionary stack with two permanent dictionaries in it (system and user dictionaries).- Throws:
PsyUndefinedException- when TODO.
-
-
Method Details
-
clone
- Overrides:
clonein classArrayList<PsyFormalDict<PsyObject>>
-
load
Performs in-depth search for the given key in this stack and returns the associated value.- Type Parameters:
T- the type of the value.- Parameters:
key- the key.- Returns:
- the associated value.
- Throws:
PsyUndefinedException- if the key is not found.
-
load
Performs in-depth search for the givenstringkey in this stack and returns the associated value.- Type Parameters:
T- the type of the value.- Parameters:
oKey- thestringkey.- Returns:
- the associated value.
- Throws:
PsyUndefinedException- if the key is not found.
-
where
-
currentNamespace
-
store
-
begin
Pushes the dictionary to this stack.- Parameters:
oDict- theformaldictdictionary.
-
end
Pops a non-permanent dictionary from this stack.- Throws:
PsyDictStackUnderflowException- if this stack does not contain non-permanent dictionaries.
-