Package jadex.rules.eca
Class ExpressionCondition
- java.lang.Object
-
- jadex.rules.eca.ExpressionCondition
-
- All Implemented Interfaces:
ICondition
public class ExpressionCondition extends java.lang.Object implements ICondition
-
-
Field Summary
Fields Modifier and Type Field Description protected UnparsedExpressionexpressionThe condition expression.protected SimpleValueFetcherfetcherThe fetcher.-
Fields inherited from interface jadex.rules.eca.ICondition
FALSE, TRUE, TRUE_CONDITION
-
-
Constructor Summary
Constructors Constructor Description ExpressionCondition(UnparsedExpression expression, IValueFetcher fetcher)Create a new ExpressionCondition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<Tuple2<java.lang.Boolean,java.lang.Object>>evaluate(IEvent event)Evaluate the condition.UnparsedExpressiongetExpression()Get the expression.SimpleValueFetchergetFetcher()Get the fetcher.voidsetExpression(UnparsedExpression expression)Set the expression.voidsetFetcher(SimpleValueFetcher fetcher)Set the fetcher.
-
-
-
Field Detail
-
expression
protected UnparsedExpression expression
The condition expression.
-
fetcher
protected SimpleValueFetcher fetcher
The fetcher.
-
-
Constructor Detail
-
ExpressionCondition
public ExpressionCondition(UnparsedExpression expression, IValueFetcher fetcher)
Create a new ExpressionCondition.
-
-
Method Detail
-
evaluate
public IFuture<Tuple2<java.lang.Boolean,java.lang.Object>> evaluate(IEvent event)
Evaluate the condition.- Specified by:
evaluatein interfaceICondition- Parameters:
event- The event.- Returns:
- True, if condition is met (plus additional user data).
-
getExpression
public UnparsedExpression getExpression()
Get the expression.- Returns:
- The expression.
-
setExpression
public void setExpression(UnparsedExpression expression)
Set the expression.- Parameters:
expression- The expression to set.
-
getFetcher
public SimpleValueFetcher getFetcher()
Get the fetcher.- Returns:
- The fetcher.
-
setFetcher
public void setFetcher(SimpleValueFetcher fetcher)
Set the fetcher.- Parameters:
fetcher- The fetcher to set.
-
-