org.drools.rule
Class ReturnValueRestriction

java.lang.Object
  extended by org.drools.rule.ReturnValueRestriction
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Acceptor, AcceptsReadAccessor, Restriction, Wireable

public class ReturnValueRestriction
extends Object
implements Restriction, AcceptsReadAccessor, Wireable

See Also:
Serialized Form

Nested Class Summary
static class ReturnValueRestriction.ReturnValueContextEntry
           
 
Constructor Summary
ReturnValueRestriction()
           
ReturnValueRestriction(InternalReadAccessor fieldExtractor, Declaration[] previousDeclarations, Declaration[] localDeclarations, String[] requiredGlobals, Evaluator evaluator)
           
ReturnValueRestriction(InternalReadAccessor fieldExtractor, ReturnValueExpression returnValueExpression, Declaration[] previousDeclarations, Declaration[] localDeclarations, String[] requiredGlobals, Evaluator evaluator)
           
 
Method Summary
 Object clone()
           
 ContextEntry createContextEntry()
           
 boolean equals(Object object)
           
 Evaluator getEvaluator()
           
 ReturnValueExpression getExpression()
           
 Declaration[] getLocalDeclarations()
           
 Declaration[] getPreviousDeclarations()
           
 Declaration[] getRequiredDeclarations()
           
 String[] getRequiredGlobals()
           
 int hashCode()
           
 boolean isAllowed(InternalReadAccessor extractor, InternalFactHandle handle, InternalWorkingMemory workingMemory, ContextEntry context)
           
 boolean isAllowed(InternalReadAccessor readAccessor, InternalFactHandle handle, Tuple tuple, WorkingMemory workingMemory, ContextEntry context)
           
 boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
           
 boolean isAllowedCachedRight(LeftTuple tuple, ContextEntry context)
           
 boolean isTemporal()
          Returns true if this is a temporal restriction
 void readExternal(ObjectInput in)
           
 void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
          A restriction may be required to replace an old declaration object by a new updated one
 void setReadAccessor(InternalReadAccessor readAccessor)
           
 void setReturnValueExpression(ReturnValueExpression expression)
           
 void wire(Object object)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReturnValueRestriction

public ReturnValueRestriction()

ReturnValueRestriction

public ReturnValueRestriction(InternalReadAccessor fieldExtractor,
                              Declaration[] previousDeclarations,
                              Declaration[] localDeclarations,
                              String[] requiredGlobals,
                              Evaluator evaluator)

ReturnValueRestriction

public ReturnValueRestriction(InternalReadAccessor fieldExtractor,
                              ReturnValueExpression returnValueExpression,
                              Declaration[] previousDeclarations,
                              Declaration[] localDeclarations,
                              String[] requiredGlobals,
                              Evaluator evaluator)
Method Detail

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

setReadAccessor

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

getRequiredDeclarations

public Declaration[] getRequiredDeclarations()
Specified by:
getRequiredDeclarations in interface Restriction

getPreviousDeclarations

public Declaration[] getPreviousDeclarations()

getLocalDeclarations

public Declaration[] getLocalDeclarations()

getRequiredGlobals

public String[] getRequiredGlobals()

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 Restriction

wire

public void wire(Object object)
Specified by:
wire in interface Wireable

setReturnValueExpression

public void setReturnValueExpression(ReturnValueExpression expression)

getExpression

public ReturnValueExpression getExpression()

getEvaluator

public Evaluator getEvaluator()
Specified by:
getEvaluator in interface Restriction

isTemporal

public boolean isTemporal()
Description copied from interface: Restriction
Returns true if this is a temporal restriction

Specified by:
isTemporal in interface Restriction
Returns:

isAllowed

public boolean isAllowed(InternalReadAccessor readAccessor,
                         InternalFactHandle handle,
                         Tuple tuple,
                         WorkingMemory workingMemory,
                         ContextEntry context)

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 Restriction

isAllowedCachedRight

public boolean isAllowedCachedRight(LeftTuple tuple,
                                    ContextEntry context)
Specified by:
isAllowedCachedRight in interface Restriction

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 Restriction

clone

public Object clone()
Specified by:
clone in interface Restriction
Overrides:
clone in class Object


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