Package jason.asSyntax
Class NumberTermImpl
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.NumberTermImpl
- All Implemented Interfaces:
NumberTerm
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
Immutable class that implements a term that represents a number
- See Also:
-
Field Summary
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
-
Constructor Summary
ConstructorDescriptionNumberTermImpl
(double vl) NumberTermImpl
(String sn) Deprecated.prefer to use ASSyntax.parseNumber -
Method Summary
Methods inherited from class jason.asSyntax.DefaultTerm
capply, cloneNS, countVars, getCyclicVar, getErrorMsg, getSrcInfo, hashCode, hasVar, isArithExpr, isAtom, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isMap, isPlanBody, isPred, isRule, isSet, isString, isStructure, isUnnamedVar, isVar, parse, resetHashCodeCache, setSrcInfo, subsumes
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface jason.asSyntax.Term
capply, cloneNS, countVars, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isAtom, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isMap, isPlanBody, isPred, isRule, isSet, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumes
Methods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
NumberTermImpl
public NumberTermImpl() -
NumberTermImpl
Deprecated.prefer to use ASSyntax.parseNumber -
NumberTermImpl
public NumberTermImpl(double vl) -
NumberTermImpl
-
-
Method Details
-
solve
public double solve()Description copied from interface:NumberTerm
returns the numeric value of the term- Specified by:
solve
in interfaceNumberTerm
-
clone
- Specified by:
clone
in interfaceTerm
- Specified by:
clone
in classDefaultTerm
-
isNumeric
public boolean isNumeric()- Specified by:
isNumeric
in interfaceTerm
- Overrides:
isNumeric
in classDefaultTerm
-
equals
-
calcHashCode
protected int calcHashCode()- Specified by:
calcHashCode
in classDefaultTerm
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Term>
- Overrides:
compareTo
in classDefaultTerm
-
toString
-
getAsDOM
get as XML -
getAsJson
public javax.json.JsonValue getAsJson()
-