Class Term.Call

  • Enclosing class:
    Term

    public static final class Term.Call
    extends Term
    A call of a (or reference to a) Function.
    • Field Detail

      • function

        protected final Function function
      • args

        protected final Term[] args
    • Constructor Detail

    • Method Detail

      • getRetType

        public int getRetType()
        Description copied from class: Term
        Gets the term's "natural" return type.
        Specified by:
        getRetType in class Term
        Returns:
        the type, should always be one of the TYPE_X constants defined in this class.
      • getFunction

        public Function getFunction()
      • getArgCount

        public int getArgCount()
      • getArg

        public Term getArg()
      • getArg

        public Term getArg​(int index)
      • getArgs

        public Term[] getArgs()
      • evalB

        public boolean evalB​(EvalEnv env)
        Description copied from class: Term
        Evaluates this term to a boolean value.
        Specified by:
        evalB in class Term
        Parameters:
        env - the application dependant environment.
        Returns:
        a boolean value
      • evalI

        public int evalI​(EvalEnv env)
        Description copied from class: Term
        Evaluates this term to an int value.
        Specified by:
        evalI in class Term
        Parameters:
        env - the application dependant environment.
        Returns:
        an int value
      • evalD

        public double evalD​(EvalEnv env)
        Description copied from class: Term
        Evaluates this term to a double value.
        Specified by:
        evalD in class Term
        Parameters:
        env - the application dependant environment.
        Returns:
        a double value
      • getChildren

        public Term[] getChildren()
        Description copied from class: Term
        Returns an array of terms which are children of this term.
        Overrides:
        getChildren in class Term
        Returns:
        an array of terms, never null but can be empty
      • toString

        public String toString()
        Description copied from class: Term
        Returns a string representation of this term which can be used for debugging.
        Specified by:
        toString in class Term
      • accept

        public <T> T accept​(TermVisitor<T> visitor)
        Description copied from class: Term
        Visitor support.
        Specified by:
        accept in class Term
        Parameters:
        visitor - A visitor.
      • isConst

        public boolean isConst()
        Specified by:
        isConst in class Term
        Returns:
        true, if this term evaluates to the same constant value regardless of any EvalEnv, even null.
      • compare

        public int compare​(Term other)
        Specified by:
        compare in class Term
      • pre

        public int pre()
        Specified by:
        pre in class Term