Package org.drools.mvel.evaluators
Class PointInTimeEvaluator
- java.lang.Object
-
- org.drools.mvel.evaluators.BaseEvaluator
-
- org.drools.mvel.evaluators.PointInTimeEvaluator
-
- All Implemented Interfaces:
Externalizable,Serializable,org.drools.core.rule.accessor.Evaluator,MvelEvaluator,org.kie.api.runtime.rule.Evaluator
- Direct Known Subclasses:
AfterEvaluatorDefinition.AfterEvaluator,BeforeEvaluatorDefinition.BeforeEvaluator
public abstract class PointInTimeEvaluator extends BaseEvaluator
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected longfinalRangeprotected longinitRangeprotected StringparamTextprotected booleanunwrapLeftprotected booleanunwrapRight
-
Constructor Summary
Constructors Constructor Description PointInTimeEvaluator()PointInTimeEvaluator(org.drools.core.base.ValueType type, org.drools.drl.parser.impl.Operator operator, long[] parameters, String paramText, boolean unwrapLeft, boolean unwrapRight)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)protected abstract booleanevaluate(long rightTS, long leftTS)booleanevaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor extractor, org.drools.core.common.InternalFactHandle object1, org.drools.core.rule.accessor.FieldValue object2)booleanevaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor extractor1, org.drools.core.common.InternalFactHandle handle1, org.drools.core.rule.accessor.ReadAccessor extractor2, org.drools.core.common.InternalFactHandle handle2)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.protected abstract longgetLeftTimestamp(org.drools.core.common.InternalFactHandle handle)protected abstract longgetRightTimestamp(org.drools.core.common.InternalFactHandle handle)inthashCode()booleanisTemporal()voidreadExternal(ObjectInput in)StringtoString()voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.drools.mvel.evaluators.BaseEvaluator
getCoercedValueType, getInterval, getOperator, getValueType
-
-
-
-
Field Detail
-
initRange
protected long initRange
-
finalRange
protected long finalRange
-
paramText
protected String paramText
-
unwrapLeft
protected boolean unwrapLeft
-
unwrapRight
protected boolean unwrapRight
-
-
Constructor Detail
-
PointInTimeEvaluator
public PointInTimeEvaluator()
-
PointInTimeEvaluator
public PointInTimeEvaluator(org.drools.core.base.ValueType type, org.drools.drl.parser.impl.Operator operator, long[] parameters, String paramText, boolean unwrapLeft, boolean unwrapRight)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classBaseEvaluator- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classBaseEvaluator- Throws:
IOException
-
isTemporal
public boolean isTemporal()
- Specified by:
isTemporalin interfaceorg.drools.core.rule.accessor.Evaluator- Specified by:
isTemporalin interfaceorg.kie.api.runtime.rule.Evaluator- Overrides:
isTemporalin classBaseEvaluator
-
evaluate
protected abstract boolean evaluate(long rightTS, long leftTS)
-
getLeftTimestamp
protected abstract long getLeftTimestamp(org.drools.core.common.InternalFactHandle handle)
-
getRightTimestamp
protected abstract long getRightTimestamp(org.drools.core.common.InternalFactHandle handle)
-
evaluate
public boolean evaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor extractor, org.drools.core.common.InternalFactHandle object1, org.drools.core.rule.accessor.FieldValue object2)
-
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.
-
evaluate
public boolean evaluate(org.drools.core.common.ReteEvaluator reteEvaluator, org.drools.core.rule.accessor.ReadAccessor extractor1, org.drools.core.common.InternalFactHandle handle1, org.drools.core.rule.accessor.ReadAccessor extractor2, org.drools.core.common.InternalFactHandle handle2)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseEvaluator
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBaseEvaluator
-
toString
public String toString()
- Overrides:
toStringin classBaseEvaluator
-
-