Package jason.asSyntax
Class NumberTermImpl
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.NumberTermImpl
- All Implemented Interfaces:
NumberTerm
,Term
,ToDOM
,ToJson
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Term>
public final class NumberTermImpl extends DefaultTerm implements NumberTerm
Immutable class that implements a term that represents a number
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
private static long
serialVersionUID
private double
value
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
-
Constructor Summary
Constructors Constructor Description NumberTermImpl()
NumberTermImpl(double vl)
NumberTermImpl(NumberTermImpl t)
NumberTermImpl(java.lang.String sn)
Deprecated.prefer to use ASSyntax.parseNumber -
Method Summary
Modifier and Type Method Description protected int
calcHashCode()
NumberTerm
clone()
int
compareTo(Term o)
boolean
equals(java.lang.Object o)
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get as XMLjavax.json.JsonValue
getAsJson()
boolean
isNumeric()
double
solve()
returns the numeric value of the termjava.lang.String
toString()
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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
logger
private static java.util.logging.Logger logger -
value
private final double value
-
-
Constructor Details
-
NumberTermImpl
public NumberTermImpl() -
NumberTermImpl
@Deprecated public NumberTermImpl(java.lang.String sn)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
public boolean equals(java.lang.Object o) -
calcHashCode
protected int calcHashCode()- Specified by:
calcHashCode
in classDefaultTerm
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<Term>
- Overrides:
compareTo
in classDefaultTerm
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)get as XML -
getAsJson
public javax.json.JsonValue getAsJson()
-