Package org.drools.core.rule.constraint
Class EvaluatorConstraint
- java.lang.Object
-
- org.drools.core.rule.MutableTypeConstraint
-
- org.drools.core.rule.constraint.EvaluatorConstraint
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,IntervalProviderConstraint,AlphaNodeFieldConstraint,BetaNodeFieldConstraint,Constraint,RuleComponent
public class EvaluatorConstraint extends MutableTypeConstraint implements IntervalProviderConstraint
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEvaluatorConstraint.LiteralContextEntry-
Nested classes/interfaces inherited from interface org.drools.core.spi.Constraint
Constraint.ConstraintType
-
-
Field Summary
Fields Modifier and Type Field Description protected Declaration[]declarationsprotected Evaluatorevaluatorprotected FieldValuefieldprotected InternalReadAccessorrightReadAccessor
-
Constructor Summary
Constructors Constructor Description EvaluatorConstraint()EvaluatorConstraint(Declaration[] declarations, Evaluator evaluator, InternalReadAccessor extractor)EvaluatorConstraint(FieldValue field, Evaluator evaluator, InternalReadAccessor extractor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EvaluatorConstraintclone()Clones the constraintContextEntrycreateContextEntry()booleanequals(Object o)EvaluatorgetEvaluator()FieldValuegetField()IntervalgetInterval()Declaration[]getRequiredDeclarations()Returns all the declarations required by the given constraint implementation.protected InternalReadAccessorgetRightReadAccessor()inthashCode()booleanisAllowed(InternalFactHandle handle, InternalWorkingMemory workingMemory)booleanisAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)booleanisAllowedCachedRight(Tuple tuple, ContextEntry context)protected booleanisLiteral()booleanisSelf()booleanisTemporal()Returns true in case this constraint is a temporal constraintvoidreadExternal(ObjectInput in)voidreplaceDeclaration(Declaration oldDecl, Declaration newDecl)When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch.voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.drools.core.rule.MutableTypeConstraint
cloneIfInUse, getType, setInUse, setType
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.drools.core.spi.Constraint
addPackageNames, equals, getListenedPropertyMask, getPackageNames, getType, mergeEvaluationContext, registerEvaluationContext
-
-
-
-
Field Detail
-
declarations
protected Declaration[] declarations
-
evaluator
protected Evaluator evaluator
-
rightReadAccessor
protected InternalReadAccessor rightReadAccessor
-
field
protected FieldValue field
-
-
Constructor Detail
-
EvaluatorConstraint
public EvaluatorConstraint()
-
EvaluatorConstraint
public EvaluatorConstraint(FieldValue field, Evaluator evaluator, InternalReadAccessor extractor)
-
EvaluatorConstraint
public EvaluatorConstraint(Declaration[] declarations, Evaluator evaluator, InternalReadAccessor extractor)
-
-
Method Detail
-
isLiteral
protected boolean isLiteral()
-
isAllowed
public boolean isAllowed(InternalFactHandle handle, InternalWorkingMemory workingMemory)
- Specified by:
isAllowedin interfaceAlphaNodeFieldConstraint
-
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
- Specified by:
isAllowedCachedLeftin interfaceBetaNodeFieldConstraint
-
isAllowedCachedRight
public boolean isAllowedCachedRight(Tuple tuple, ContextEntry context)
- Specified by:
isAllowedCachedRightin interfaceBetaNodeFieldConstraint
-
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
Description copied from interface:ConstraintWhen a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch. Since this is done at ReteOO build type, when constraints were already created, eventually some constraints need to update their references to the declarations.- Specified by:
replaceDeclarationin interfaceConstraint
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
Description copied from interface:ConstraintReturns all the declarations required by the given constraint implementation.- Specified by:
getRequiredDeclarationsin interfaceConstraint- Returns:
-
isTemporal
public boolean isTemporal()
Description copied from interface:ConstraintReturns true in case this constraint is a temporal constraint- Specified by:
isTemporalin interfaceConstraint- Returns:
-
isSelf
public boolean isSelf()
-
getInterval
public Interval getInterval()
- Specified by:
getIntervalin interfaceIntervalProviderConstraint
-
getEvaluator
public Evaluator getEvaluator()
-
getField
public FieldValue getField()
-
getRightReadAccessor
protected InternalReadAccessor getRightReadAccessor()
-
clone
public EvaluatorConstraint clone()
Description copied from interface:ConstraintClones the constraint- Specified by:
clonein interfaceConstraint- Specified by:
clonein classMutableTypeConstraint- Returns:
-
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntryin interfaceBetaNodeFieldConstraint
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classMutableTypeConstraint- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classMutableTypeConstraint- Throws:
IOExceptionClassNotFoundException
-
-