Class DefaultTerm

java.lang.Object
jason.asSyntax.DefaultTerm
All Implemented Interfaces:
Term, ToDOM, ToJson, Serializable, Cloneable, Comparable<Term>
Direct Known Subclasses:
Literal, MapTermImpl, NumberTermImpl, ObjectTermImpl, SetTermImpl, StringTermImpl

public abstract class DefaultTerm extends Object implements Term, Serializable
Base class for all terms. (this class may be renamed to AbstractTerm in future releases of Jason, so avoid using it -- use ASSyntax class to create new terms)
See Also:
  • Field Details

    • hashCodeCache

      protected Integer hashCodeCache
    • srcInfo

      protected SourceInfo srcInfo
  • Constructor Details

    • DefaultTerm

      public DefaultTerm()
  • Method Details

    • parse

      @Deprecated public static Term parse(String sTerm)
      Deprecated.
      it is preferable to use ASSyntax.parseTerm
    • isVar

      public boolean isVar()
      Specified by:
      isVar in interface Term
    • isUnnamedVar

      public boolean isUnnamedVar()
      Specified by:
      isUnnamedVar in interface Term
    • isLiteral

      public boolean isLiteral()
      Specified by:
      isLiteral in interface Term
    • isRule

      public boolean isRule()
      Specified by:
      isRule in interface Term
    • isList

      public boolean isList()
      Specified by:
      isList in interface Term
    • isSet

      public boolean isSet()
      Specified by:
      isSet in interface Term
    • isMap

      public boolean isMap()
      Specified by:
      isMap in interface Term
    • isString

      public boolean isString()
      Specified by:
      isString in interface Term
    • isInternalAction

      public boolean isInternalAction()
      Specified by:
      isInternalAction in interface Term
    • isArithExpr

      public boolean isArithExpr()
      Specified by:
      isArithExpr in interface Term
    • isNumeric

      public boolean isNumeric()
      Specified by:
      isNumeric in interface Term
    • isPred

      public boolean isPred()
      Specified by:
      isPred in interface Term
    • isStructure

      public boolean isStructure()
      Specified by:
      isStructure in interface Term
    • isAtom

      public boolean isAtom()
      Specified by:
      isAtom in interface Term
    • isPlanBody

      public boolean isPlanBody()
      Specified by:
      isPlanBody in interface Term
    • isGround

      public boolean isGround()
      Specified by:
      isGround in interface Term
    • isCyclicTerm

      public boolean isCyclicTerm()
      Specified by:
      isCyclicTerm in interface Term
    • getCyclicVar

      public VarTerm getCyclicVar()
      Specified by:
      getCyclicVar in interface Term
    • hasVar

      public boolean hasVar(VarTerm t, Unifier u)
      Specified by:
      hasVar in interface Term
    • countVars

      public void countVars(Map<VarTerm,Integer> c)
      Specified by:
      countVars in interface Term
    • clone

      public abstract Term clone()
      Specified by:
      clone in interface Term
      Overrides:
      clone in class Object
    • calcHashCode

      protected abstract int calcHashCode()
    • hashCode

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

      public void resetHashCodeCache()
    • compareTo

      public int compareTo(Term t)
      Specified by:
      compareTo in interface Comparable<Term>
    • subsumes

      public boolean subsumes(Term l)
      Specified by:
      subsumes in interface Term
    • capply

      public Term capply(Unifier u)
      Description copied from interface: Term
      clone and applies together (and faster than clone and then apply)
      Specified by:
      capply in interface Term
    • cloneNS

      public Term cloneNS(Atom newnamespace)
      Description copied from interface: Term
      clone in another namespace
      Specified by:
      cloneNS in interface Term
    • getSrcInfo

      public SourceInfo getSrcInfo()
      Specified by:
      getSrcInfo in interface Term
    • setSrcInfo

      public void setSrcInfo(SourceInfo s)
      Description copied from interface: Term
      Removes the value cached for hashCode
      Specified by:
      setSrcInfo in interface Term
    • getErrorMsg

      public String getErrorMsg()