Class StaticVariableSet<T>

java.lang.Object
com.fathzer.soft.javaluator.StaticVariableSet<T>
Type Parameters:
T - The type of the values of the variable (the one handled by the evaluator).
All Implemented Interfaces:
AbstractVariableSet<T>

public class StaticVariableSet<T> extends Object implements AbstractVariableSet<T>
A static variable set.
Here, static means that the values of variables are set before starting to evaluate the expressions.
Author:
Jean-Marc Astesana
See Also:
  • Constructor Details

    • StaticVariableSet

      public StaticVariableSet()
      Constructor.
      Builds a new empty variable set.
  • Method Details

    • get

      public T get(String variableName)
      Gets the value of a variable.
      Specified by:
      get in interface AbstractVariableSet<T>
      Parameters:
      variableName - The name of the variable.
      Returns:
      The value of the variable.
    • set

      public void set(String variableName, T value)
      Sets a variable value.
      Parameters:
      variableName - The variable name
      value - The variable value (null to remove a variable from the set).