Drools :: Core 6.1.0.Beta1

org.drools.core.rule.constraint
Class QueryNameConstraint

java.lang.Object
  extended by org.drools.core.rule.constraint.QueryNameConstraint
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, IndexableConstraint, Acceptor, AcceptsReadAccessor, AlphaNodeFieldConstraint, Constraint, RuleComponent

public class QueryNameConstraint
extends Object
implements AlphaNodeFieldConstraint, IndexableConstraint, AcceptsReadAccessor, Externalizable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.drools.core.spi.Constraint
Constraint.ConstraintType
 
Constructor Summary
QueryNameConstraint()
           
QueryNameConstraint(InternalReadAccessor readAccessor, String queryName)
           
 
Method Summary
 Constraint clone()
          Clones the constraint
 QueryNameConstraint cloneIfInUse()
          Clone this constraints only if it is already used by a different node, otherwise returns this
 ContextEntry createContextEntry()
           
 boolean equals(Object obj)
           
 IndexUtil.ConstraintType getConstraintType()
           
 FieldValue getField()
           
 InternalReadAccessor getFieldExtractor()
           
 AbstractHashTable.FieldIndex getFieldIndex()
           
 String getQueryName()
           
 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 UNKNOWN
 int hashCode()
           
 boolean isAllowed(InternalFactHandle handle, InternalWorkingMemory workingMemory, ContextEntry context)
           
 boolean isIndexable(short nodeType)
           
 boolean isTemporal()
          Returns true in case this constraint is a temporal constraint
 boolean isUnification()
           
 void 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.
 void setReadAccessor(InternalReadAccessor readAccessor)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryNameConstraint

public QueryNameConstraint()

QueryNameConstraint

public QueryNameConstraint(InternalReadAccessor readAccessor,
                           String queryName)
Method Detail

createContextEntry

public ContextEntry createContextEntry()
Specified by:
createContextEntry in interface AlphaNodeFieldConstraint

isAllowed

public boolean isAllowed(InternalFactHandle handle,
                         InternalWorkingMemory workingMemory,
                         ContextEntry context)
Specified by:
isAllowed in interface AlphaNodeFieldConstraint

isUnification

public boolean isUnification()
Specified by:
isUnification in interface IndexableConstraint

isIndexable

public boolean isIndexable(short nodeType)
Specified by:
isIndexable in interface IndexableConstraint

getConstraintType

public IndexUtil.ConstraintType getConstraintType()
Specified by:
getConstraintType in interface IndexableConstraint

getField

public FieldValue getField()
Specified by:
getField in interface IndexableConstraint

getFieldIndex

public AbstractHashTable.FieldIndex getFieldIndex()
Specified by:
getFieldIndex in interface IndexableConstraint

getFieldExtractor

public InternalReadAccessor getFieldExtractor()
Specified by:
getFieldExtractor in interface IndexableConstraint

setReadAccessor

public void setReadAccessor(InternalReadAccessor readAccessor)
Specified by:
setReadAccessor in interface AcceptsReadAccessor

getRequiredDeclarations

public Declaration[] getRequiredDeclarations()
Description copied from interface: Constraint
Returns all the declarations required by the given constraint implementation.

Specified by:
getRequiredDeclarations in interface Constraint
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 interface Constraint

clone

public Constraint clone()
Description copied from interface: Constraint
Clones the constraint

Specified by:
clone in interface Constraint
Overrides:
clone in class Object
Returns:

getQueryName

public String getQueryName()

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 interface Constraint
Returns:

isTemporal

public boolean isTemporal()
Description copied from interface: Constraint
Returns true in case this constraint is a temporal constraint

Specified by:
isTemporal in interface Constraint
Returns:

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

cloneIfInUse

public QueryNameConstraint cloneIfInUse()
Description copied from interface: AlphaNodeFieldConstraint
Clone this constraints only if it is already used by a different node, otherwise returns this

Specified by:
cloneIfInUse in interface AlphaNodeFieldConstraint

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

Drools :: Core 6.1.0.Beta1

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.