Package org.aavso.tools.vstar.vela
Class VeLaEnvironment<T>
java.lang.Object
org.aavso.tools.vstar.vela.VeLaEnvironment<T>
- Direct Known Subclasses:
EmptyVeLaEnvironment,VeLaScope,VeLaValidObservationEnvironment
A generic symbol binding and lookup environment implementation,
the base class for all VeLa environments.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an environment with an empty name and constant set.Construct an environment with a specified empty name and constant set. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(VeLaEnvironment<T> other) Add all symbol bindings from another scope to this one.voidBind a value to a name.
It is an invariant that a constant binding cannot be overridden.booleanhasBinding(String name) Deprecated.booleanisEmpty()Is this VeLa environment empty?booleanIs this environment mutable (can be modified)?Lookup the named symbol in the environment.toString()
-
Field Details
-
cache
-
constants
-
-
Constructor Details
-
VeLaEnvironment
public VeLaEnvironment()Construct an environment with an empty name and constant set. -
VeLaEnvironment
Construct an environment with a specified empty name and constant set.
-
-
Method Details
-
isMutable
public boolean isMutable()Is this environment mutable (can be modified)?- Returns:
- true if mutable, false if not
-
lookup
Lookup the named symbol in the environment.- Parameters:
name- The symbol's name.- Returns:
- An optional Operand instance if it exists.
-
hasBinding
Deprecated.Does this environment contain the named binding?- Parameters:
name- The name of the binding to lookup.- Returns:
- Whether the name is bound in this environment. Less useful now, given the use of Optional values
-
bind
Bind a value to a name.
It is an invariant that a constant binding cannot be overridden.- Parameters:
name- The name to which to bind the value.value- The value to be bound.isConstant- Is this a constant binding?
-
addAll
Add all symbol bindings from another scope to this one.- Parameters:
other- The scope to be added to this one.
-
isEmpty
public boolean isEmpty()Is this VeLa environment empty? -
toString
-