Package apron

Class Texpr1VarNode

java.lang.Object
apron.Texpr1Node
apron.Texpr1VarNode
All Implemented Interfaces:
Serializable, Cloneable

public class Texpr1VarNode extends Texpr1Node implements Cloneable, Serializable
Class of variable leaves in Texpr1Node level 1 expression trees.

A variable is represented as a Var name.

See Also:
  • Field Details

    • var

      public Var var
      Variable name.
  • Constructor Details

    • Texpr1VarNode

      public Texpr1VarNode(String v)
      Constructs a new variable leaf.
    • Texpr1VarNode

      public Texpr1VarNode(Var v)
  • Method Details

    • shallowCopy

      public Texpr1Node shallowCopy()
      Description copied from class: Texpr1Node
      Shallow copy.
      Specified by:
      shallowCopy in class Texpr1Node
    • deepCopy

      public Texpr1Node deepCopy()
      Description copied from class: Texpr1Node
      Deep copy.
      Specified by:
      deepCopy in class Texpr1Node
    • toTexpr0Node

      public Texpr0Node toTexpr0Node(Environment e)
      Description copied from class: Texpr1Node
      Converts the level 1 tree to a level 0 tree in the given environment.
      Specified by:
      toTexpr0Node in class Texpr1Node
    • toString

      public String toString()
      Description copied from class: Texpr1Node
      Converts the expression tree to a String.
      Specified by:
      toString in class Texpr1Node
    • getVariable

      public Var getVariable()
    • setVariable

      public void setVariable(String v)
    • setVariable

      public void setVariable(Var v)
    • getDepth

      public int getDepth()
      Description copied from class: Texpr1Node
      Returns the depth of the expression tree.
      Specified by:
      getDepth in class Texpr1Node
    • getSize

      public int getSize()
      Description copied from class: Texpr1Node
      Returns the number of internal nodes in the tree.
      Specified by:
      getSize in class Texpr1Node
    • hasVar

      public boolean hasVar(Var v)
      Description copied from class: Texpr1Node
      Whether the variable var occurs in the tree.
      Specified by:
      hasVar in class Texpr1Node
    • fillVars

      protected void fillVars(HashSet<Var> set)
      Description copied from class: Texpr1Node
      Used internally for getVars.
      Specified by:
      fillVars in class Texpr1Node
    • isIntervalCst

      public boolean isIntervalCst()
      Description copied from class: Texpr1Node
      Whether the expression is constant.
      Specified by:
      isIntervalCst in class Texpr1Node
    • isIntervalLinear

      public boolean isIntervalLinear()
      Description copied from class: Texpr1Node
      Whether the expression is linear with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalLinear in class Texpr1Node
    • isIntervalPolynomial

      public boolean isIntervalPolynomial()
      Description copied from class: Texpr1Node
      Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalPolynomial in class Texpr1Node
    • isIntervalPolyfrac

      public boolean isIntervalPolyfrac()
      Description copied from class: Texpr1Node
      Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalPolyfrac in class Texpr1Node
    • isScalar

      public boolean isScalar()
      Description copied from class: Texpr1Node
      Whether all coefficients are scalar (non interval).
      Specified by:
      isScalar in class Texpr1Node
    • substitute

      public Texpr1Node substitute(String v, Texpr1Node t)
      Overrides:
      substitute in class Texpr1Node
    • substitute

      public Texpr1Node substitute(Var v, Texpr1Node t)
      Description copied from class: Texpr1Node
      Substitutes all occurrences of the variable var with the tree t.

      this is modified in-place.

      As some nodes can change their kind (a node for a variable var becomes the root of the tree t), a new root node is returned.

      Specified by:
      substitute in class Texpr1Node
    • hashCode

      public int hashCode()
      Description copied from class: Texpr1Node
      Recursive hashing.
      Specified by:
      hashCode in class Texpr1Node
    • isEqual

      public boolean isEqual(Texpr1Node t)
      Description copied from class: Texpr1Node
      Structural (recursive) equality.
      Specified by:
      isEqual in class Texpr1Node
    • getPrecedence

      public int getPrecedence()
      Description copied from class: Texpr1Node
      Precedence of the node, used when printing.
      Specified by:
      getPrecedence in class Texpr1Node
    • equals

      public boolean equals(Object x)
      Description copied from class: Texpr1Node
      Whether x is a Texpr1 tree and structurally equal to this.
      Specified by:
      equals in class Texpr1Node