Package jason.asSyntax
Class PlanBodyImpl
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.PlanBodyImpl
- All Implemented Interfaces:
LogicalFormula,PlanBody,Term,ToDOM,ToJson,Serializable,Cloneable,Comparable<Term>,Iterable<PlanBody>
Represents a plan body item (achieve, test, action, ...) and its successors.
A plan body like
a1; ?t; !g is represented by the following structure
(a1, (?t, (!g, ()))).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface jason.asSyntax.PlanBody
PlanBody.BodyType -
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
ConstructorsConstructorDescriptionconstructor for empty plan bodyPlanBodyImpl(PlanBody.BodyType t, boolean planTerm) PlanBodyImpl(PlanBody.BodyType t, Term b, boolean planTerm) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanclone the plan body and adds it in the end of this planintclone and applies together (and faster than clone and then apply)clone()make a deep copy of the termsclonePB()clone the plan bodybooleanintgetArity()returns the number of terms of this literalget as XMLgetHead()intgetTerm(int i) returns the i-th term (first term is 0)getTerms()returns all terms of this literalbooleanisAtom()booleanbooleanbooleaniterator()logicalConsequence(Agent ag, Unifier un) logicalConsequence checks whether one particular predicate is a logical consequence of the belief base.removeBody(int index) voidsetAsBodyTerm(boolean b) voidsetBodyNext(PlanBody next) voidsetBodyTerm(Term t) voidvoidtoString()Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, cloneNS, countVars, delTerm, getSingletonVars, getTermsSize, hasTerm, hasVar, isGround, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerms, subsumes, varToReplaceMethods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNSMethods inherited from class jason.asSyntax.Literal
addAnnot, addAnnots, addAnnots, addSource, addSourceInfoAsAnnots, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsJson, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfoMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface jason.asSyntax.Term
cloneNS, countVars, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isMap, isNumeric, isPred, isRule, isSet, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumesMethods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Constructor Details
-
PlanBodyImpl
public PlanBodyImpl()constructor for empty plan body -
PlanBodyImpl
-
PlanBodyImpl
-
PlanBodyImpl
-
PlanBodyImpl
-
-
Method Details
-
setBodyNext
- Specified by:
setBodyNextin interfacePlanBody
-
getBodyNext
- Specified by:
getBodyNextin interfacePlanBody
-
isEmptyBody
public boolean isEmptyBody()- Specified by:
isEmptyBodyin interfacePlanBody
-
getBodyType
- Specified by:
getBodyTypein interfacePlanBody
-
setBodyType
- Specified by:
setBodyTypein interfacePlanBody
-
getBodyTerm
- Specified by:
getBodyTermin interfacePlanBody
-
getHead
-
setBodyTerm
- Specified by:
setBodyTermin interfacePlanBody
-
isBodyTerm
public boolean isBodyTerm()- Specified by:
isBodyTermin interfacePlanBody
-
isAtom
public boolean isAtom() -
setAsBodyTerm
public void setAsBodyTerm(boolean b) - Specified by:
setAsBodyTermin interfacePlanBody
-
isPlanBody
public boolean isPlanBody()- Specified by:
isPlanBodyin interfaceTerm- Overrides:
isPlanBodyin classDefaultTerm
-
iterator
-
getArity
public int getArity()Description copied from class:Literalreturns the number of terms of this literal -
getTerm
Description copied from class:Literalreturns the i-th term (first term is 0) -
getTerms
Description copied from class:Literalreturns all terms of this literal -
setTerm
-
logicalConsequence
Description copied from class:LiterallogicalConsequence checks whether one particular predicate is a logical consequence of the belief base. Returns an iterator for all unifiers that are logCons.- Specified by:
logicalConsequencein interfaceLogicalFormula- Overrides:
logicalConsequencein classLiteral
-
equals
-
calcHashCode
public int calcHashCode()- Overrides:
calcHashCodein classStructure
-
add
clone the plan body and adds it in the end of this plan -
getLastBody
- Specified by:
getLastBodyin interfacePlanBody
-
add
-
removeBody
- Specified by:
removeBodyin interfacePlanBody
-
getPlanSize
public int getPlanSize()- Specified by:
getPlanSizein interfacePlanBody
-
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply) -
clone
Description copied from class:Structuremake a deep copy of the terms -
clonePB
Description copied from interface:PlanBodyclone the plan body -
toString
-
getAsDOM
get as XML
-