Class MathExpression.VariableRegistry
java.lang.Object
com.github.gbenroscience.parser.MathExpression.VariableRegistry
- All Implemented Interfaces:
Savable,Serializable
- Enclosing class:
MathExpression
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidIntroduces a VariablevoidIntroduces an array or variable-args list of Variableclone()voiddumpVars()intReturns the slot index for a variable name.booleanhasVariable(String name) Gives no choice but to search for aVariableonly in the localMathExpression.VariableRegistryof theMathExpressionvoidreset()Do not use except if necessaryintsize()Returns the total number of slots required for the execution frame.
-
Constructor Details
-
VariableRegistry
public VariableRegistry()
-
-
Method Details
-
getSlot
Returns the slot index for a variable name. If the name is new, it assigns a new slot.- Parameters:
name- The name of the Variable
-
hasVariable
-
lookUp
- Parameters:
vName- The name of theMathExpression- Returns:
- the
Variableif found or null
-
lookUp
Gives no choice but to search for aVariableonly in the localMathExpression.VariableRegistryof theMathExpression- Parameters:
vName- The name of theMathExpressionlocalOnly- If true, will only check theMathExpression'sMathExpression.VariableRegistry- Returns:
-
saveIfNotExists
-
saveOrUpdate
-
add
Introduces a Variable- Parameters:
v- the name of the Variable object to be added to the Variable Registry
-
add
Introduces an array or variable-args list of Variable- Parameters:
vars- the variable args list of the Variable objects to be added to the Variable Registry
-
size
public int size()Returns the total number of slots required for the execution frame. -
reset
public void reset() -
dumpVars
public void dumpVars() -
clone
-