org.drools.rule
Class PredicateConstraint
java.lang.Object
org.drools.rule.MutableTypeConstraint
org.drools.rule.PredicateConstraint
- All Implemented Interfaces:
- Externalizable, Serializable, Cloneable, AlphaNodeFieldConstraint, BetaNodeFieldConstraint, Constraint, Restriction, RuleComponent, Wireable
public class PredicateConstraint
- extends MutableTypeConstraint
- implements Restriction, Wireable, Externalizable
A predicate can be written as a top level constraint or be nested
inside inside a field constraint (and as so, must implement the
Restriction interface).
- See Also:
- Serialized Form
PredicateConstraint
public PredicateConstraint()
PredicateConstraint
public PredicateConstraint(PredicateExpression evaluator)
PredicateConstraint
public PredicateConstraint(Declaration[] previousDeclarations,
Declaration[] localDeclarations)
PredicateConstraint
public PredicateConstraint(PredicateExpression expression,
Declaration[] previousDeclarations,
Declaration[] localDeclarations,
String[] requiredGlobals,
String[] requiredOperators)
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class MutableTypeConstraint
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class MutableTypeConstraint
- Throws:
IOException
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- Specified by:
getRequiredDeclarations in interface Restriction
- Returns:
getPreviousDeclarations
public Declaration[] getPreviousDeclarations()
getLocalDeclarations
public Declaration[] getLocalDeclarations()
getGlobals
public String[] getGlobals()
getOperators
public String[] getOperators()
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl,
Declaration newDecl)
- Description copied from interface:
Restriction
- A restriction may be required to replace an old
declaration object by a new updated one
- Specified by:
replaceDeclaration in interface Constraint- Specified by:
replaceDeclaration in interface Restriction
wire
public void wire(Object object)
- Specified by:
wire in interface Wireable
setPredicateExpression
public void setPredicateExpression(PredicateExpression expression)
getPredicateExpression
public PredicateExpression getPredicateExpression()
isTemporal
public boolean isTemporal()
- Description copied from interface:
Restriction
- Returns true if this is a temporal restriction
- Specified by:
isTemporal in interface Constraint- Specified by:
isTemporal in interface Restriction
- Returns:
toString
public String toString()
- Overrides:
toString in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object object)
- Overrides:
equals in class Object
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntry in interface AlphaNodeFieldConstraint- Specified by:
createContextEntry in interface BetaNodeFieldConstraint- Specified by:
createContextEntry in interface Restriction
isAllowed
public boolean isAllowed(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
ContextEntry ctx)
- Specified by:
isAllowed in interface AlphaNodeFieldConstraint
isAllowed
public boolean isAllowed(InternalReadAccessor extractor,
InternalFactHandle handle,
InternalWorkingMemory workingMemory,
ContextEntry context)
- Specified by:
isAllowed in interface Restriction
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context,
InternalFactHandle handle)
- Specified by:
isAllowedCachedLeft in interface BetaNodeFieldConstraint- Specified by:
isAllowedCachedLeft in interface Restriction
isAllowedCachedRight
public boolean isAllowedCachedRight(LeftTuple tuple,
ContextEntry context)
- Specified by:
isAllowedCachedRight in interface BetaNodeFieldConstraint- Specified by:
isAllowedCachedRight in interface Restriction
clone
public PredicateConstraint clone()
- Description copied from interface:
Constraint
- Clones the constraint
- Specified by:
clone in interface Constraint- Specified by:
clone in interface Restriction- Specified by:
clone in class MutableTypeConstraint
- Returns:
getEvaluator
public Evaluator getEvaluator()
- Specified by:
getEvaluator in interface Restriction
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.