Class AbstractTerm

java.lang.Object
fr.lirmm.graphik.integraal.api.core.AbstractTerm
All Implemented Interfaces:
Term, Serializable, Comparable<Term>

public abstract class AbstractTerm extends Object implements Term
Base implementation of Term with shared typing and comparison logic.
Author:
Clément Sipieter (INRIA) <clement@6pi.fr>
See Also:
  • Constructor Details

    • AbstractTerm

      protected AbstractTerm()
      Creates an abstract term base implementation.
  • Method Details

    • getLabel

      public String getLabel()
      Description copied from interface: Term
      Return a label that represents this term. There is no guarantee that two terms with the same label represent the same term (see Term.getIdentifier()).
      Specified by:
      getLabel in interface Term
      Returns:
      a label that represents this term.
    • isConstant

      public final boolean isConstant()
      Description copied from interface: Term
      Returns true iff this term is a Constant. The returned value of Term.isConstant() must be equals to !Term.isVariable().
      Specified by:
      isConstant in interface Term
      Returns:
      true if this term is a constant, false otherwise.
    • isVariable

      public final boolean isVariable()
      Description copied from interface: Term
      Returns true if this term is a Variable. The returned value of Term.isVariable() must be equals to !Term.isConstant().
      Specified by:
      isVariable in interface Term
      Returns:
      true if this term is a variable, false otherwise.
    • isLiteral

      public final boolean isLiteral()
      Description copied from interface: Term
      Returns true if this term is a literal, in this case Term.isConstant() must also return true.
      Specified by:
      isLiteral in interface Term
      Returns:
      true if this term is a literal, false otherwise.
    • compareTo

      public int compareTo(Term o)
      Specified by:
      compareTo in interface Comparable<Term>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(Term term)
      Compares this term with another one using type and identifier equality.
      Parameters:
      term - the term to compare with
      Returns:
      true if both terms have the same type and identifier
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object