- All Implemented Interfaces:
Serializable,Cloneable,Iterable<PsyFormalDict<PsyObject>>,Collection<PsyFormalDict<PsyObject>>,List<PsyFormalDict<PsyObject>>,RandomAccess
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 oDict) Pushes the dictionary to this stack.clone()voidend()Pops a non-permanent dictionary from this stack.<T extends PsyObject>
Tload(PsyTextual oKey) Performs in-depth search for the giventextualkey 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) where(PsyTextual oKey) Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, 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, 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
-
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 giventextualkey in this stack and returns the associated value.- Type Parameters:
T- the type of the value.- Parameters:
oKey- thetextualkey.- Returns:
- the associated value.
- Throws:
PsyUndefinedException- if the key is not found.
-
where
Performs in-depth search for the dictionary containing the given key in this stack and returns anOptionalcontating the dictionary found or emptyOptionalif not found.- Parameters:
key- the key.- Returns:
- a
Optionalcontaining the dictionary found.
-
where
Performs in-depth search for the dictionary containing the giventextualkey in this stack and returns anOptionalcontating the dictionary found or emptyOptionalif not found.- Parameters:
oKey- thetextualkey.- Returns:
- an
Optionalcontaining the dictionary found.
-
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.
-