Class TermNode

java.lang.Object
com.graphbuilder.math.Expression
com.graphbuilder.math.TermNode
Direct Known Subclasses:
FuncNode, VarNode

public abstract class TermNode extends Expression
A node of an expression tree that represents a variable or a function.
  • Field Details

    • name

      protected String name
    • negate

      protected boolean negate
  • Constructor Details

    • TermNode

      public TermNode(String name, boolean negate)
  • Method Details

    • getNegate

      public boolean getNegate()
      Returns true if the term should negate the result before returning it in the eval method.
    • setNegate

      public void setNegate(boolean b)
    • getName

      public String getName()
      Returns the name of the term.
    • setName

      public void setName(String s)
      Sets the name of the term. Valid names must not begin with a digit or a decimal, and must not contain round brackets, operators, commas or whitespace.
      Throws:
      IllegalArgumentException - If the name is null or invalid.