Package org.drools.base.rule.constraint
Class QueryNameConstraint
- java.lang.Object
-
- org.drools.base.rule.constraint.QueryNameConstraint
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,AcceptsReadAccessor,AlphaNodeFieldConstraint,Constraint,IndexableConstraint,RuleComponent
public class QueryNameConstraint extends java.lang.Object implements AlphaNodeFieldConstraint, IndexableConstraint, AcceptsReadAccessor, java.io.Externalizable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.drools.base.rule.constraint.Constraint
Constraint.ConstraintType
-
-
Constructor Summary
Constructors Constructor Description QueryNameConstraint()QueryNameConstraint(ReadAccessor readAccessor, java.lang.String queryName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Constraintclone()Clones the constraintQueryNameConstraintcloneIfInUse()Clone this constraints only if it is already used by a different node, otherwise returns thisbooleanequals(java.lang.Object obj)ConstraintTypeOperatorgetConstraintType()FieldValuegetField()ReadAccessorgetFieldExtractor()FieldIndexgetFieldIndex()DeclarationgetIndexExtractor()java.lang.StringgetQueryName()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(org.kie.api.runtime.rule.FactHandle handle, ValueResolver valueResolver)booleanisIndexable(short nodeType, org.kie.api.KieBaseConfiguration config)booleanisTemporal()Returns true in case this constraint is a temporal constraintbooleanisUnification()voidreadExternal(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.voidsetReadAccessor(ReadAccessor readAccessor)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.base.rule.constraint.Constraint
addPackageNames, equals, getListenedPropertyMask, getListenedPropertyMask, getPackageNames, mergeEvaluationContext, registerEvaluationContext
-
Methods inherited from interface org.drools.base.rule.IndexableConstraint
unsetUnification
-
-
-
-
Constructor Detail
-
QueryNameConstraint
public QueryNameConstraint()
-
QueryNameConstraint
public QueryNameConstraint(ReadAccessor readAccessor, java.lang.String queryName)
-
-
Method Detail
-
isAllowed
public boolean isAllowed(org.kie.api.runtime.rule.FactHandle handle, ValueResolver valueResolver)- Specified by:
isAllowedin interfaceAlphaNodeFieldConstraint
-
isUnification
public boolean isUnification()
- Specified by:
isUnificationin interfaceIndexableConstraint
-
isIndexable
public boolean isIndexable(short nodeType, org.kie.api.KieBaseConfiguration config)- Specified by:
isIndexablein interfaceIndexableConstraint
-
getConstraintType
public ConstraintTypeOperator getConstraintType()
- Specified by:
getConstraintTypein interfaceIndexableConstraint
-
getField
public FieldValue getField()
- Specified by:
getFieldin interfaceIndexableConstraint
-
getFieldIndex
public FieldIndex getFieldIndex()
- Specified by:
getFieldIndexin interfaceIndexableConstraint
-
getFieldExtractor
public ReadAccessor getFieldExtractor()
- Specified by:
getFieldExtractorin interfaceIndexableConstraint
-
setReadAccessor
public void setReadAccessor(ReadAccessor readAccessor)
- Specified by:
setReadAccessorin interfaceAcceptsReadAccessor
-
getIndexExtractor
public Declaration getIndexExtractor()
- Specified by:
getIndexExtractorin interfaceIndexableConstraint
-
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 Constraint clone()
Description copied from interface:ConstraintClones the constraint- Specified by:
clonein interfaceConstraint- Overrides:
clonein classjava.lang.Object- Returns:
-
getQueryName
public java.lang.String getQueryName()
-
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:
-
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
-
cloneIfInUse
public QueryNameConstraint 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
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-