Package org.drools.core.rule.constraint
Class NegConstraint
- java.lang.Object
-
- org.drools.core.rule.constraint.NegConstraint
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,AlphaNodeFieldConstraint,Constraint,RuleComponent
public class NegConstraint extends java.lang.Object implements AlphaNodeFieldConstraint
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.drools.core.rule.constraint.Constraint
Constraint.ConstraintType
-
-
Constructor Summary
Constructors Constructor Description NegConstraint()NegConstraint(boolean operator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NegConstraintclone()Clones the constraintAlphaNodeFieldConstraintcloneIfInUse()Clone this constraints only if it is already used by a different node, otherwise returns thisbooleanequals(java.lang.Object o)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(InternalFactHandle handle, ReteEvaluator reteEvaluator)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.booleansetInUse()voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.drools.core.rule.constraint.Constraint
addPackageNames, equals, getListenedPropertyMask, getPackageNames, mergeEvaluationContext, registerEvaluationContext
-
-
-
-
Method Detail
-
isAllowed
public boolean isAllowed(InternalFactHandle handle, ReteEvaluator reteEvaluator)
- Specified by:
isAllowedin interfaceAlphaNodeFieldConstraint
-
cloneIfInUse
public AlphaNodeFieldConstraint cloneIfInUse()
Description copied from interface:AlphaNodeFieldConstraintClone this constraints only if it is already used by a different node, otherwise returns this- Specified by:
cloneIfInUsein interfaceAlphaNodeFieldConstraint
-
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
-
clone
public NegConstraint 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:
-
isTemporal
public boolean isTemporal()
Description copied from interface:ConstraintReturns true in case this constraint is a temporal constraint- Specified by:
isTemporalin interfaceConstraint- Returns:
-
setInUse
public boolean setInUse()
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-