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
Modifier and TypeFieldDescriptionstatic final Bindings
A predefined empty set of bindings; use this instead of null when you do not want to bind any name. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a value.boolean
Tells if a given variable is bound to a value or not.Retrieves all the name/value mappings.void
Assigns a value to a variable.void
Destroys 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.
-