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
Nested Classes -
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone and applies together (and faster than clone and then apply)clone()make a deep copy of the termsbooleanintgetArity()returns the number of terms of this literalget as XMLreturn [+|-][!|?] super.getPredicateIndicatorgetTerm(int i) returns the i-th term (first term is 0)getType()booleanbooleanbooleanbooleanisGoal()booleanbooleanisUpdate()returns true if the trigger is an add (+bel) or del (-bel)static TriggerparseTrigger(String sTe) prefer to use ASSyntax.parseTriggerbooleanvoidsetAsTriggerTerm(boolean b) voidsetLiteral(Literal literal) voidvoidvoidtoString()static Triggertry 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, 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, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, logicalConsequence, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, 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, isPred, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfoMethods 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:Literalreturns the number of terms of this literal -
getTerm
Description copied from class:Literalreturns 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:Structuremake a deep copy of the terms -
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply) -
getPredicateIndicator
return [+|-][!|?] super.getPredicateIndicator- Overrides:
getPredicateIndicatorin 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
-