Package org.drools.core.common
Class InstanceNotEqualsConstraint
- java.lang.Object
-
- org.drools.core.common.InstanceNotEqualsConstraint
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,BetaNodeFieldConstraint
,Constraint
,RuleComponent
public class InstanceNotEqualsConstraint extends Object implements BetaNodeFieldConstraint
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InstanceNotEqualsConstraint.InstanceNotEqualsConstraintContextEntry
-
Nested classes/interfaces inherited from interface org.drools.core.spi.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 InstanceNotEqualsConstraint
clone()
Clones the constraintBetaNodeFieldConstraint
cloneIfInUse()
Clone this constraints only if it is already used by a different node, otherwise returns thisContextEntry
createContextEntry()
boolean
equals(Object object)
Pattern
getOtherPattern()
Declaration[]
getRequiredDeclarations()
Returns all the declarations required by the given constraint implementation.Constraint.ConstraintType
getType()
Returns the type of the constraint, either ALPHA, BETA or UNKNOWNint
hashCode()
boolean
isAllowed(ContextEntry entry)
boolean
isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
boolean
isAllowedCachedRight(Tuple tuple, ContextEntry context)
boolean
isTemporal()
Returns true in case this constraint is a temporal constraintvoid
readExternal(ObjectInput in)
void
replaceDeclaration(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.String
toString()
void
writeExternal(ObjectOutput out)
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.spi.Constraint
addPackageNames, equals, getListenedPropertyMask, getListenedPropertyMask, getPackageNames, mergeEvaluationContext, registerEvaluationContext
-
-
-
-
Constructor Detail
-
InstanceNotEqualsConstraint
public InstanceNotEqualsConstraint()
-
InstanceNotEqualsConstraint
public InstanceNotEqualsConstraint(Pattern otherPattern)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
Description copied from interface:Constraint
Returns all the declarations required by the given constraint implementation.- Specified by:
getRequiredDeclarations
in interfaceConstraint
- Returns:
-
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
Description copied from interface:Constraint
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. 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:
replaceDeclaration
in interfaceConstraint
-
getOtherPattern
public Pattern getOtherPattern()
-
isTemporal
public boolean isTemporal()
Description copied from interface:Constraint
Returns true in case this constraint is a temporal constraint- Specified by:
isTemporal
in interfaceConstraint
- Returns:
-
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntry
in interfaceBetaNodeFieldConstraint
-
isAllowed
public boolean isAllowed(ContextEntry entry)
-
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
- Specified by:
isAllowedCachedLeft
in interfaceBetaNodeFieldConstraint
-
isAllowedCachedRight
public boolean isAllowedCachedRight(Tuple tuple, ContextEntry context)
- Specified by:
isAllowedCachedRight
in interfaceBetaNodeFieldConstraint
-
clone
public InstanceNotEqualsConstraint clone()
Description copied from interface:Constraint
Clones the constraint- Specified by:
clone
in interfaceConstraint
- Overrides:
clone
in classObject
- Returns:
-
getType
public Constraint.ConstraintType getType()
Description copied from interface:Constraint
Returns the type of the constraint, either ALPHA, BETA or UNKNOWN- Specified by:
getType
in interfaceConstraint
- Returns:
-
cloneIfInUse
public BetaNodeFieldConstraint cloneIfInUse()
Description copied from interface:BetaNodeFieldConstraint
Clone this constraints only if it is already used by a different node, otherwise returns this- Specified by:
cloneIfInUse
in interfaceBetaNodeFieldConstraint
-
-