Class MathExpression.VariableRegistry

java.lang.Object
com.github.gbenroscience.parser.MathExpression.VariableRegistry
Enclosing class:
MathExpression

public static final class MathExpression.VariableRegistry extends Object
Manages the mapping of variable names to frame slots. Use one instance per MathExpression compilation.
Author:
GBENRO
  • Constructor Details

    • VariableRegistry

      public VariableRegistry()
  • Method Details

    • getSlot

      public int getSlot(String name)
      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

      public boolean hasVariable(String name)
    • size

      public int size()
      Returns the total number of slots required for the execution frame.
    • reset

      public void reset()