org.drools.spi
Interface Constraint

All Superinterfaces:
Cloneable, Externalizable, RuleComponent, Serializable
All Known Subinterfaces:
AlphaNodeFieldConstraint, BetaNodeFieldConstraint
All Known Implementing Classes:
AbstractCompositeConstraint, AndConstraint, InstanceEqualsConstraint, InstanceNotEqualsConstraint, LiteralConstraint, MultiRestrictionFieldConstraint, MutableTypeConstraint, OrConstraint, PredicateConstraint, ReturnValueConstraint, TupleStartEqualsConstraint, VariableConstraint

public interface Constraint
extends RuleComponent, Externalizable, Cloneable


Nested Class Summary
static class Constraint.ConstraintType
          An enum for Constraint Types
 
Method Summary
 Object clone()
          Clones the constraint
 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
 boolean isTemporal()
          Returns true in case this constraint is a temporal constraint
 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.
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Method Detail

getRequiredDeclarations

Declaration[] getRequiredDeclarations()
Returns all the declarations required by the given constraint implementation.

Returns:

replaceDeclaration

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. Since this is done at ReteOO build type, when constraints were already created, eventually some constraints need to update their references to the declarations.

Parameters:
oldDecl -
newDecl -

clone

Object clone()
Clones the constraint

Returns:

getType

Constraint.ConstraintType getType()
Returns the type of the constraint, either ALPHA, BETA or UNKNOWN

Returns:

isTemporal

boolean isTemporal()
Returns true in case this constraint is a temporal constraint

Returns:


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.