Package jason.asSyntax
Class ArithExpr
- All Implemented Interfaces:
LogicalFormula
,NumberTerm
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
Represents and solve arithmetic expressions like "10 + 30".
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class jason.asSyntax.ArithFunctionTerm
value
Fields inherited from class jason.asSyntax.Structure
emptyTermArray, emptyTermList
Fields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
-
Constructor Summary
ConstructorDescriptionArithExpr
(ArithExpr.ArithmeticOp oper, NumberTerm t1) ArithExpr
(NumberTerm t1, ArithExpr.ArithmeticOp oper, NumberTerm t2) -
Method Summary
Modifier and TypeMethodDescriptioncomputes the value for this arithmetic function (as defined in the NumberTerm interface)boolean
checkArity
(int a) clone()
make a hard copy of the termsclone in another namespaceget as XMLgetLHS()
gets the LHS of this ExpressiongetOp()
gets the Operation of this ExpressiongetRHS()
gets the RHS of this Expressionstatic NumberTerm
returns some Term that can be evaluated as Numberstatic NumberTerm
returns some Term that can be evaluated as NumbertoString()
Methods inherited from class jason.asSyntax.ArithFunctionTerm
compareTo, equals, getAgent, getErrorMsg, isArithExpr, isAtom, isLiteral, isNumeric, isStructure, logicalConsequence, setAgent, solve
Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, calcHashCode, countVars, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, hasVar, isGround, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, varToReplace
Methods inherited from class jason.asSyntax.Atom
getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addAnnot, addAnnots, addAnnots, addSource, addSourceInfoAsAnnots, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsJson, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isCyclicTerm, isInternalAction, isList, isMap, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface jason.asSyntax.NumberTerm
solve
Methods inherited from interface jason.asSyntax.Term
countVars, equals, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isAtom, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumes
Methods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Constructor Details
-
ArithExpr
-
ArithExpr
-
-
Method Details
-
parseExpr
returns some Term that can be evaluated as Number -
parseExpr
returns some Term that can be evaluated as Number -
capply
Description copied from class:ArithFunctionTerm
computes the value for this arithmetic function (as defined in the NumberTerm interface)- Specified by:
capply
in interfaceTerm
- Overrides:
capply
in classArithFunctionTerm
-
checkArity
public boolean checkArity(int a) - Overrides:
checkArity
in classArithFunctionTerm
-
clone
make a hard copy of the terms- Specified by:
clone
in interfaceTerm
- Overrides:
clone
in classArithFunctionTerm
-
cloneNS
Description copied from interface:Term
clone in another namespace- Specified by:
cloneNS
in interfaceTerm
- Overrides:
cloneNS
in classArithFunctionTerm
-
getOp
gets the Operation of this Expression -
getLHS
gets the LHS of this Expression -
getRHS
gets the RHS of this Expression -
toString
-
getAsDOM
get as XML- Specified by:
getAsDOM
in interfaceToDOM
- Overrides:
getAsDOM
in classArithFunctionTerm
-