Package jason.asSyntax
Class LiteralImpl
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.Pred
jason.asSyntax.LiteralImpl
- All Implemented Interfaces:
LogicalFormula
,Term
,ToDOM
,ToJson
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Term>
- Direct Known Subclasses:
CyclicTerm
,Rule
,VarTerm
public class LiteralImpl extends Pred
A Literal extends a Pred with strong negation (~).
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class jason.asSyntax.Literal
Literal.FalseLiteral, Literal.TrueLiteral
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private boolean
type
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
Constructors Modifier Constructor Description LiteralImpl(boolean pos, Literal l)
if pos == true, the literal is positive, otherwise it is negativeLiteralImpl(boolean pos, java.lang.String functor)
if pos == true, the literal is positive, otherwise it is negativeLiteralImpl(Atom namespace, boolean pos, Literal l)
creates a literal based on another but in another name space and signalLiteralImpl(Atom namespace, boolean pos, java.lang.String functor)
if pos == true, the literal is positive, otherwise it is negativeLiteralImpl(Literal l)
protected
LiteralImpl(Literal l, Unifier u)
LiteralImpl(java.lang.String functor)
creates a positive literal -
Method Summary
Modifier and Type Method Description protected int
calcHashCode()
boolean
canBeAddedInBB()
to be overridden by subclasses (as internal action)Term
capply(Unifier u)
clone and applies together (and faster than clone and then apply)Term
clone()
make a deep copy of the termsLiteral
cloneNS(Atom newNameSpace)
clone in another namespaceboolean
equals(java.lang.Object o)
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get as XMLjava.lang.String
getErrorMsg()
PredicateIndicator
getPredicateIndicator()
returns [~] super.getPredicateIndicatorboolean
isAtom()
boolean
negated()
returns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned valueLiteral
setNegated(boolean b)
changes the negation of the literal and return thisMethods inherited from class jason.asSyntax.Pred
addAnnot, addAnnots, addAnnots, addSource, capplyAnnots, clearAnnots, countVars, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnot, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, hasVar, importAnnots, isGround, isPred, makeVarsAnnon, parsePred, setAnnots, toStringAsTerm
Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, toString, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, newFunctor, noSource, parseLiteral, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, 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 jason.asSyntax.Term
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfo
Methods inherited from interface jason.util.ToJson
getAsJsonStr
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
type
private boolean type
-
-
Constructor Details
-
LiteralImpl
public LiteralImpl(java.lang.String functor)creates a positive literal -
LiteralImpl
public LiteralImpl(boolean pos, java.lang.String functor)if pos == true, the literal is positive, otherwise it is negative -
LiteralImpl
-
LiteralImpl
-
LiteralImpl
if pos == true, the literal is positive, otherwise it is negative -
LiteralImpl
if pos == true, the literal is positive, otherwise it is negative -
LiteralImpl
creates a literal based on another but in another name space and signal
-
-
Method Details
-
isAtom
public boolean isAtom() -
canBeAddedInBB
public boolean canBeAddedInBB()to be overridden by subclasses (as internal action)- Overrides:
canBeAddedInBB
in classLiteral
-
negated
public boolean negated()Description copied from class:Literal
returns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned value -
setNegated
Description copied from class:Literal
changes the negation of the literal and return this- Overrides:
setNegated
in classLiteral
-
equals
public boolean equals(java.lang.Object o) -
getErrorMsg
public java.lang.String getErrorMsg()- Overrides:
getErrorMsg
in classDefaultTerm
-
clone
Description copied from class:Structure
make a deep copy of the terms -
capply
Description copied from interface:Term
clone and applies together (and faster than clone and then apply) -
cloneNS
Description copied from interface:Term
clone in another namespace -
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCode
in classStructure
-
getPredicateIndicator
returns [~] super.getPredicateIndicator- Overrides:
getPredicateIndicator
in classLiteral
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)get as XML
-