Package jason.asSyntax
Class StringTermImpl
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.StringTermImpl
- All Implemented Interfaces:
StringTerm
,Term
,ToDOM
,ToJson
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Term>
public final class StringTermImpl extends DefaultTerm implements StringTerm
Immutable class for string terms.
- Author:
- Jomi
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
private static long
serialVersionUID
private java.lang.String
value
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
-
Constructor Summary
Constructors Constructor Description StringTermImpl()
StringTermImpl(StringTermImpl t)
StringTermImpl(java.lang.String fs)
-
Method Summary
Modifier and Type Method Description protected int
calcHashCode()
StringTerm
clone()
int
compareTo(Term o)
boolean
equals(java.lang.Object t)
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get as XMLjavax.json.JsonValue
getAsJson()
java.lang.String
getString()
gets the Java string represented by this term, it normally does not return the same string as toString (which enclose the string by quotes)boolean
isString()
int
length()
static StringTerm
parseString(java.lang.String sTerm)
java.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, isNumeric, isPlanBody, isPred, isRule, isSet, 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, isNumeric, isPlanBody, isPred, isRule, isSet, 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 java.lang.String value
-
-
Constructor Details
-
StringTermImpl
public StringTermImpl() -
StringTermImpl
public StringTermImpl(java.lang.String fs) -
StringTermImpl
-
-
Method Details
-
getString
public java.lang.String getString()Description copied from interface:StringTerm
gets the Java string represented by this term, it normally does not return the same string as toString (which enclose the string by quotes)- Specified by:
getString
in interfaceStringTerm
-
clone
- Specified by:
clone
in interfaceTerm
- Specified by:
clone
in classDefaultTerm
-
parseString
-
isString
public boolean isString()- Specified by:
isString
in interfaceTerm
- Overrides:
isString
in classDefaultTerm
-
length
public int length()- Specified by:
length
in interfaceStringTerm
-
equals
public boolean equals(java.lang.Object t) -
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()
-