org.drools.rule
Class PredicateConstraint

java.lang.Object
  extended by org.drools.rule.MutableTypeConstraint
      extended by org.drools.rule.PredicateConstraint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, AlphaNodeFieldConstraint, BetaNodeFieldConstraint, Constraint, RuleComponent

public class PredicateConstraint
extends MutableTypeConstraint

See Also:
Serialized Form

Nested Class Summary
static class PredicateConstraint.PredicateContextEntry
           
 
Nested classes/interfaces inherited from interface org.drools.spi.Constraint
Constraint.ConstraintType
 
Constructor Summary
PredicateConstraint(Declaration[] previousDeclarations, Declaration[] localDeclarations)
           
PredicateConstraint(PredicateExpression evaluator)
           
PredicateConstraint(PredicateExpression expression, Declaration[] previousDeclarations, Declaration[] localDeclarations, java.lang.String[] requiredGlobals)
           
 
Method Summary
 java.lang.Object clone()
          Clones the constraint
 ContextEntry createContextEntry()
           
 boolean equals(java.lang.Object object)
           
 Declaration[] getLocalDeclarations()
           
 PredicateExpression getPredicateExpression()
           
 Declaration[] getPreviousDeclarations()
           
 Declaration[] getRequiredDeclarations()
          Returns all the declarations required by the given constraint implementation.
 int hashCode()
           
 boolean isAllowed(Extractor extractor, InternalFactHandle handle, InternalWorkingMemory workingMemory, ContextEntry context)
           
 boolean isAllowed(java.lang.Object object, InternalWorkingMemory workingMemory, ContextEntry ctx)
           
 boolean isAllowedCachedLeft(ContextEntry context, java.lang.Object object)
           
 boolean isAllowedCachedRight(ReteTuple tuple, ContextEntry context)
           
 void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
          A constraint may be required to replace an old declaration object by a new updated one
 void setPredicateExpression(PredicateExpression expression)
           
 java.lang.String toString()
           
 
Methods inherited from class org.drools.rule.MutableTypeConstraint
getType, setType
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PredicateConstraint

public PredicateConstraint(PredicateExpression evaluator)

PredicateConstraint

public PredicateConstraint(Declaration[] previousDeclarations,
                           Declaration[] localDeclarations)

PredicateConstraint

public PredicateConstraint(PredicateExpression expression,
                           Declaration[] previousDeclarations,
                           Declaration[] localDeclarations,
                           java.lang.String[] requiredGlobals)
Method Detail

getRequiredDeclarations

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

Returns:

getPreviousDeclarations

public Declaration[] getPreviousDeclarations()

getLocalDeclarations

public Declaration[] getLocalDeclarations()

replaceDeclaration

public void replaceDeclaration(Declaration oldDecl,
                               Declaration newDecl)
Description copied from interface: Constraint
A constraint may be required to replace an old declaration object by a new updated one


setPredicateExpression

public void setPredicateExpression(PredicateExpression expression)

getPredicateExpression

public PredicateExpression getPredicateExpression()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

createContextEntry

public ContextEntry createContextEntry()

isAllowed

public boolean isAllowed(java.lang.Object object,
                         InternalWorkingMemory workingMemory,
                         ContextEntry ctx)

isAllowed

public boolean isAllowed(Extractor extractor,
                         InternalFactHandle handle,
                         InternalWorkingMemory workingMemory,
                         ContextEntry context)

isAllowedCachedLeft

public boolean isAllowedCachedLeft(ContextEntry context,
                                   java.lang.Object object)

isAllowedCachedRight

public boolean isAllowedCachedRight(ReteTuple tuple,
                                    ContextEntry context)

clone

public java.lang.Object clone()
Description copied from interface: Constraint
Clones the constraint

Specified by:
clone in interface Constraint
Specified by:
clone in class MutableTypeConstraint
Returns: