Class VariableToken

java.lang.Object
net.objecthunter.exp4j.tokenizer.Token
net.objecthunter.exp4j.tokenizer.VariableToken
All Implemented Interfaces:
Serializable

public final class VariableToken extends Token
represents a setVariable used in an expression
See Also:
  • Constructor Details

    • VariableToken

      public VariableToken(String name)
      Create a new instance
      Parameters:
      name - the name of the setVariable
  • Method Details

    • getName

      public String getName()
      Get the name of the setVariable
      Returns:
      the name
    • getValue

      public double getValue()
      Retrieves the currently assigned value for this Variable
      Returns:
      value
    • setValue

      public void setValue(double value)
      Sets a new value for this Variable
      Parameters:
      value - new value for this variable
    • isValueSet

      public boolean isValueSet()
      Tells if a value has been set for this variable
      Returns:
      true if a value has been set, and false otherwise
    • copy

      public VariableToken copy()
      Retrieves a copy of this token
      Returns:
      VariableToken
    • toString

      public String toString()
      Overrides:
      toString in class Object