Package org.drools.core.reteoo.builder
Class InstanceNotEqualsConstraint
- java.lang.Object
-
- org.drools.core.reteoo.builder.InstanceNotEqualsConstraint
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,BetaNodeFieldConstraint,Constraint,RuleComponent
public class InstanceNotEqualsConstraint extends java.lang.Object implements BetaNodeFieldConstraint
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInstanceNotEqualsConstraint.InstanceNotEqualsConstraintContextEntry-
Nested classes/interfaces inherited from interface org.drools.core.rule.constraint.Constraint
Constraint.ConstraintType
-
-
Constructor Summary
Constructors Constructor Description InstanceNotEqualsConstraint()InstanceNotEqualsConstraint(Pattern otherPattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstanceNotEqualsConstraintclone()Clones the constraintBetaNodeFieldConstraintcloneIfInUse()Clone this constraints only if it is already used by a different node, otherwise returns thisContextEntrycreateContextEntry()booleanequals(java.lang.Object object)PatterngetOtherPattern()Declaration[]getRequiredDeclarations()Returns all the declarations required by the given constraint implementation.Constraint.ConstraintTypegetType()Returns the type of the constraint, either ALPHA, BETA or UNKNOWNinthashCode()booleanisAllowed(ContextEntry entry)booleanisAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)booleanisAllowedCachedRight(Tuple tuple, ContextEntry context)booleanisTemporal()Returns true in case this constraint is a temporal constraintvoidreadExternal(java.io.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.java.lang.StringtoString()voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.rule.constraint.Constraint
addPackageNames, equals, getListenedPropertyMask, getPackageNames, mergeEvaluationContext, registerEvaluationContext
-
-
-
-
Constructor Detail
-
InstanceNotEqualsConstraint
public InstanceNotEqualsConstraint()
-
InstanceNotEqualsConstraint
public InstanceNotEqualsConstraint(Pattern otherPattern)
-
-
Method Detail
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
Description copied from interface:ConstraintReturns all the declarations required by the given constraint implementation.- Specified by:
getRequiredDeclarationsin interfaceConstraint- Returns:
-
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
-
getOtherPattern
public Pattern getOtherPattern()
-
isTemporal
public boolean isTemporal()
Description copied from interface:ConstraintReturns true in case this constraint is a temporal constraint- Specified by:
isTemporalin interfaceConstraint- Returns:
-
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntryin interfaceBetaNodeFieldConstraint
-
isAllowed
public boolean isAllowed(ContextEntry entry)
-
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
- Specified by:
isAllowedCachedLeftin interfaceBetaNodeFieldConstraint
-
isAllowedCachedRight
public boolean isAllowedCachedRight(Tuple tuple, ContextEntry context)
- Specified by:
isAllowedCachedRightin interfaceBetaNodeFieldConstraint
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
clone
public InstanceNotEqualsConstraint clone()
Description copied from interface:ConstraintClones the constraint- Specified by:
clonein interfaceConstraint- Overrides:
clonein classjava.lang.Object- Returns:
-
getType
public Constraint.ConstraintType getType()
Description copied from interface:ConstraintReturns the type of the constraint, either ALPHA, BETA or UNKNOWN- Specified by:
getTypein interfaceConstraint- Returns:
-
cloneIfInUse
public BetaNodeFieldConstraint cloneIfInUse()
Description copied from interface:BetaNodeFieldConstraintClone this constraints only if it is already used by a different node, otherwise returns this- Specified by:
cloneIfInUsein interfaceBetaNodeFieldConstraint
-
-