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, emptyTermListFields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCacheFields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo -
Constructor Summary
ConstructorsModifierConstructorDescriptionLiteralImpl(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 negativeprotectedLiteralImpl(Literal l, Unifier u) LiteralImpl(String functor) creates a positive literal -
Method Summary
Modifier and TypeMethodDescriptionprotected intbooleanto 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 namespacebooleanget as XMLreturns [~] super.getPredicateIndicatorbooleanisAtom()booleannegated()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, toStringAsTermMethods 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, varToReplaceMethods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNSMethods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, newFunctor, noSource, parseLiteral, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfoMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfoMethods 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:
canBeAddedInBBin classLiteral
-
negated
public boolean negated()Description copied from class:Literalreturns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned value -
setNegated
Description copied from class:Literalchanges the negation of the literal and return this- Overrides:
setNegatedin classLiteral
-
equals
-
getErrorMsg
- Overrides:
getErrorMsgin classDefaultTerm
-
clone
Description copied from class:Structuremake a deep copy of the terms -
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply) -
cloneNS
Description copied from interface:Termclone in another namespace -
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCodein classStructure
-
getPredicateIndicator
returns [~] super.getPredicateIndicator- Overrides:
getPredicateIndicatorin classLiteral
-
getAsDOM
get as XML
-