org.drools.rule
Class ReturnValueConstraint
java.lang.Object
org.drools.rule.MutableTypeConstraint
org.drools.rule.ReturnValueConstraint
- All Implemented Interfaces:
- Externalizable, Serializable, Cloneable, Acceptor, AcceptsReadAccessor, AlphaNodeFieldConstraint, BetaNodeFieldConstraint, Constraint, RuleComponent
public class ReturnValueConstraint
- extends MutableTypeConstraint
- implements AcceptsReadAccessor, Externalizable
- See Also:
- Serialized Form
ReturnValueConstraint
public ReturnValueConstraint()
ReturnValueConstraint
public ReturnValueConstraint(InternalReadAccessor fieldExtractor,
ReturnValueRestriction restriction)
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
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
setReturnValueExpression
public void setReturnValueExpression(ReturnValueExpression expression)
getRestriction
public ReturnValueRestriction getRestriction()
getExpression
public ReturnValueExpression getExpression()
getEvaluator
public org.drools.runtime.rule.Evaluator getEvaluator()
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:
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
isAllowed
public boolean isAllowed(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
ContextEntry context)
- Specified by:
isAllowed
in interface AlphaNodeFieldConstraint
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context,
InternalFactHandle handle)
- Specified by:
isAllowedCachedLeft
in interface BetaNodeFieldConstraint
isAllowedCachedRight
public boolean isAllowedCachedRight(LeftTuple tuple,
ContextEntry context)
- Specified by:
isAllowedCachedRight
in interface BetaNodeFieldConstraint
clone
public Object clone()
- Description copied from interface:
Constraint
- Clones the constraint
- Specified by:
clone
in interface Constraint
- Specified by:
clone
in class MutableTypeConstraint
- Returns:
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.