- 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 TypeMethodDescriptionvoid
begin
(PsyFormalDict oDict) Pushes the dictionary to this stack.clone()
void
end()
Pops a non-permanent dictionary from this stack.<T extends PsyObject>
Tload
(PsyTextual oKey) Performs in-depth search for the giventextual
key 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.void
store
(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, 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
-
DictStack
Creates a new dictionary stack with two permanent dictionaries in it (system and user dictionaries).- Throws:
PsyUndefinedException
- when TODO.
-
-
Method Details
-
clone
- Overrides:
clone
in 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 giventextual
key in this stack and returns the associated value.- Type Parameters:
T
- the type of the value.- Parameters:
oKey
- thetextual
key.- 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 anOptional
contating the dictionary found or emptyOptional
if not found.- Parameters:
key
- the key.- Returns:
- a
Optional
containing the dictionary found.
-
where
Performs in-depth search for the dictionary containing the giventextual
key in this stack and returns anOptional
contating the dictionary found or emptyOptional
if not found.- Parameters:
oKey
- thetextual
key.- Returns:
- an
Optional
containing the dictionary found.
-
currentNamespace
-
store
-
begin
Pushes the dictionary to this stack.- Parameters:
oDict
- theformaldict
dictionary.
-
end
Pops a non-permanent dictionary from this stack.- Throws:
PsyDictStackUnderflowException
- if this stack does not contain non-permanent dictionaries.
-