Package jason.asSyntax
Class Trigger
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.Trigger
- All Implemented Interfaces:
LogicalFormula
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
Represents an AgentSpeak trigger (like +!g, +p, ...).
It is composed by:
an operator (+ or -);
a type (, !, or ?);
a literal
(it extends structure to be used as a term)
- See Also:
-
Nested Class Summary
-
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
-
Method Summary
Modifier and TypeMethodDescriptionclone and applies together (and faster than clone and then apply)clone()
make a deep copy of the termsboolean
int
getArity()
returns the number of terms of this literalget as XMLreturn [+|-][!|?] super.getPredicateIndicatorgetTerm
(int i) returns the i-th term (first term is 0)getType()
boolean
boolean
boolean
boolean
isGoal()
boolean
boolean
isUpdate()
returns true if the trigger is an add (+bel) or del (-bel)static Trigger
parseTrigger
(String sTe) prefer to use ASSyntax.parseTriggerboolean
void
setAsTriggerTerm
(boolean b) void
setLiteral
(Literal literal) void
void
void
toString()
static Trigger
try to convert the term t into a trigger, in case t is a trigger term, a string that can be parsed to a trigger, a var with value trigger, ....Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, calcHashCode, cloneNS, countVars, delTerm, getSingletonVars, getTerms, getTermsSize, hasTerm, hasVar, isAtom, isGround, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerms, subsumes, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods 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, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, logicalConsequence, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, 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, isPred, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfo
Methods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Trigger
-
-
Method Details
-
parseTrigger
prefer to use ASSyntax.parseTrigger -
getArity
public int getArity()Description copied from class:Literal
returns the number of terms of this literal -
getTerm
Description copied from class:Literal
returns the i-th term (first term is 0) -
setTerm
-
setTrigOp
-
sameType
-
equals
-
isAchvGoal
public boolean isAchvGoal() -
isFailureGoal
public boolean isFailureGoal() -
isGoal
public boolean isGoal() -
isUpdate
public boolean isUpdate()returns true if the trigger is an add (+bel) or del (-bel) -
isMetaEvent
public boolean isMetaEvent() -
getOperator
-
getType
-
setType
-
isAddition
public boolean isAddition() -
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) -
getPredicateIndicator
return [+|-][!|?] super.getPredicateIndicator- Overrides:
getPredicateIndicator
in classLiteral
-
getLiteral
-
setLiteral
-
setAsTriggerTerm
public void setAsTriggerTerm(boolean b) -
toString
-
tryToGetTrigger
try to convert the term t into a trigger, in case t is a trigger term, a string that can be parsed to a trigger, a var with value trigger, ....- Throws:
ParseException
-
getAsDOM
get as XML
-