Package org.drools.mvel.evaluators
Class StrEvaluatorDefinition.StrEvaluator
- java.lang.Object
-
- org.drools.mvel.evaluators.BaseEvaluator
-
- org.drools.mvel.evaluators.StrEvaluatorDefinition.StrEvaluator
-
- All Implemented Interfaces:
Externalizable,Serializable,org.drools.core.rule.accessor.Evaluator,MvelEvaluator,org.kie.api.runtime.rule.Evaluator
- Enclosing class:
- StrEvaluatorDefinition
public static class StrEvaluatorDefinition.StrEvaluator extends BaseEvaluator
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StrEvaluator()StrEvaluator(org.drools.core.base.ValueType type, boolean isNegated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanevaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor extractor, org.drools.core.common.InternalFactHandle factHandle, org.drools.core.rule.accessor.FieldValue value)booleanevaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor leftExtractor, org.drools.core.common.InternalFactHandle left, org.drools.core.rule.accessor.ReadAccessor rightExtractor, org.drools.core.common.InternalFactHandle right)booleanevaluateCachedLeft(org.drools.core.common.ReteEvaluator reteEvaluator, VariableRestriction.VariableContextEntry context, org.drools.core.common.InternalFactHandle right)Evaluates the expression using the provided parameters.booleanevaluateCachedRight(org.drools.core.common.ReteEvaluator reteEvaluator, VariableRestriction.VariableContextEntry context, org.drools.core.common.InternalFactHandle left)Evaluates the expression using the provided parameters.StrEvaluatorDefinition.OperationsgetParameter()voidsetParameterText(String parameterText)StringtoString()-
Methods inherited from class org.drools.mvel.evaluators.BaseEvaluator
equals, getCoercedValueType, getInterval, getOperator, getValueType, hashCode, isTemporal, readExternal, writeExternal
-
-
-
-
Method Detail
-
setParameterText
public void setParameterText(String parameterText)
-
getParameter
public StrEvaluatorDefinition.Operations getParameter()
-
evaluate
public boolean evaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor extractor, org.drools.core.common.InternalFactHandle factHandle, org.drools.core.rule.accessor.FieldValue value)
-
evaluate
public boolean evaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor leftExtractor, org.drools.core.common.InternalFactHandle left, org.drools.core.rule.accessor.ReadAccessor rightExtractor, org.drools.core.common.InternalFactHandle right)
-
evaluateCachedLeft
public boolean evaluateCachedLeft(org.drools.core.common.ReteEvaluator reteEvaluator, VariableRestriction.VariableContextEntry context, org.drools.core.common.InternalFactHandle right)Description copied from interface:MvelEvaluatorEvaluates the expression using the provided parameters. This method is used when evaluating left-activated beta-constraints, i.e., a fact attribute against a variable value, that is activated from the left. For instance: Person( name == $someName ) This method will be used when a new $someName variable is bound. So it will cache the value of $someName and will iterate over the right memory (Person instances) evaluating each occurrence.- Parameters:
reteEvaluator- The current working memorycontext- The previously cached context, including the left value and the extractor for the right value.right- The right object, from where to extract the value. In the above example, that is the "Person" instance from where to extract the "name" attribute.- Returns:
- Returns true if evaluation is successful. false otherwise.
-
evaluateCachedRight
public boolean evaluateCachedRight(org.drools.core.common.ReteEvaluator reteEvaluator, VariableRestriction.VariableContextEntry context, org.drools.core.common.InternalFactHandle left)Description copied from interface:MvelEvaluatorEvaluates the expression using the provided parameters. This method is used when evaluating right-activated beta-constraints, i.e., a fact attribute against a variable value, that is activated from the right. For instance: Person( name == $someName ) This method will be used when a new Person instance is evaluated. So it will cache the value of the "Person" instance and will iterate over the left memory comparing it to each "$someName" bound values.- Parameters:
reteEvaluator- The current working memorycontext- The previously cached context, including the right value and the extractor for the left value.left- The left object, from where to extract the bound variable. In the above example, that is the "$someName" variable value.- Returns:
- Returns true if evaluation is successful. false otherwise.
-
toString
public String toString()
- Overrides:
toStringin classBaseEvaluator
-
-