Package org.oristool.lello
Class Bindings
java.lang.Object
org.oristool.lello.Bindings
A collection of pairs name/value, also called bindings. This can be seen as a
set of variables each bound to a given value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BindingsA predefined empty set of bindings; use this instead of null when you do not want to bind any name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a value.booleanTells if a given variable is bound to a value or not.Retrieves all the name/value mappings.voidAssigns a value to a variable.voidDestroys a variable.
-
Field Details
-
NOBINDINGS
A predefined empty set of bindings; use this instead of null when you do not want to bind any name. This collection is read-only.
-
-
Constructor Details
-
Bindings
public Bindings()Initializes an empty set of bindings.
-
-
Method Details
-
set
Assigns a value to a variable.- Parameters:
name- The name of the variable to set.value- The new value.
-
get
Retrieves a value.- Parameters:
name- The name of the variable whose value must be retrieved.- Returns:
- The associated value.
-
unset
Destroys a variable.- Parameters:
name- The name of the variable to be destroyed.
-
isBound
Tells if a given variable is bound to a value or not.- Parameters:
name- The name of the variable to be tested.- Returns:
- true if bound, false otherwise.
-
mapValues
Retrieves all the name/value mappings.- Returns:
- A map describing all the bindings.
-