Class ExpressionVariableContext
java.lang.Object
com.blackrook.expression.ExpressionVariableContext
- All Implemented Interfaces:
ExpressionVariableSet
An open variable set in which values can be set.
The internals are written so that the storage uses few memory allocations/deletions.
- Author:
- Matthew Tropiano
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a context with a default size.ExpressionVariableContext(int capacity) Creates a context with a default size. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the context.Gets a corresponding expression value by name.booleanisEmpty()voidGets a corresponding expression value by name.voidGets a corresponding expression value by name.voidGets a corresponding expression value by name.voidset(String name, ExpressionValue value) Gets a corresponding expression value by name.intsize()toString()
-
Field Details
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITYDefault capacity.- See Also:
-
-
Constructor Details
-
ExpressionVariableContext
public ExpressionVariableContext()Creates a context with a default size.- See Also:
-
ExpressionVariableContext
public ExpressionVariableContext(int capacity) Creates a context with a default size.- Parameters:
capacity- the initial capacity.
-
-
Method Details
-
clear
public void clear()Clears the context. -
get
Description copied from interface:ExpressionVariableSetGets a corresponding expression value by name.- Specified by:
getin interfaceExpressionVariableSet- Parameters:
name- the name of the variable.- Returns:
- the value or null if no variable.
-
set
Gets a corresponding expression value by name.- Parameters:
name- the name of the variable.value- the value to set.
-
set
Gets a corresponding expression value by name.- Parameters:
name- the name of the variable.value- the value to set.
-
set
Gets a corresponding expression value by name.- Parameters:
name- the name of the variable.value- the value to set.
-
set
Gets a corresponding expression value by name.- Parameters:
name- the name of the variable.value- the value to set.
-
size
public int size()- Returns:
- the amount of variables maintained by this context.
-
isEmpty
public boolean isEmpty()- Returns:
- true if this has no variables, false of not.
-
toString
-