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
,Serializable
,Cloneable
,Comparable<Term>
- Direct Known Subclasses:
CyclicTerm
,Rule
,VarTerm
A Literal extends a Pred with strong negation (~).
- See Also:
-
Field Summary
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
ModifierConstructorDescriptionLiteralImpl
(boolean pos, Literal l) if pos == true, the literal is positive, otherwise it is negativeLiteralImpl
(boolean pos, 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, String functor) if pos == true, the literal is positive, otherwise it is negativeprotected
LiteralImpl
(Literal l, Unifier u) LiteralImpl
(String functor) creates a positive literal -
Method Summary
Modifier and TypeMethodDescriptionprotected int
boolean
to be overridden by subclasses (as internal action)clone and applies together (and faster than clone and then apply)clone()
make a deep copy of the termsclone in another namespaceboolean
get as XMLreturns [~] super.getPredicateIndicatorboolean
isAtom()
boolean
negated()
returns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned valuesetNegated
(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
-
Constructor Details
-
LiteralImpl
creates a positive literal -
LiteralImpl
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
-
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
get as XML
-