org.drools.rule
Class VariableRestriction

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

public class VariableRestriction
extends Object
implements AcceptsReadAccessor, Restriction

See Also:
Serialized Form

Nested Class Summary
static class VariableRestriction.BooleanVariableContextEntry
           
static class VariableRestriction.CharVariableContextEntry
           
static class VariableRestriction.DoubleVariableContextEntry
           
static class VariableRestriction.LongVariableContextEntry
           
static class VariableRestriction.ObjectVariableContextEntry
           
static class VariableRestriction.PrimitiveArrayVariableContextEntry
           
static class VariableRestriction.VariableContextEntry
           
 
Constructor Summary
VariableRestriction()
           
VariableRestriction(InternalReadAccessor fieldExtractor, Declaration declaration, Evaluator evaluator)
           
 
Method Summary
 Object clone()
           
 ContextEntry createContextEntry()
           
 boolean equals(Object object)
           
 Evaluator getEvaluator()
           
 Interval getInterval()
           
 InternalReadAccessor getReadAccessor()
           
 Declaration[] getRequiredDeclarations()
           
 int hashCode()
           
 boolean isAllowed(InternalReadAccessor extractor, InternalFactHandle handle, InternalWorkingMemory 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)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableRestriction

public VariableRestriction()

VariableRestriction

public VariableRestriction(InternalReadAccessor fieldExtractor,
                           Declaration declaration,
                           Evaluator evaluator)
Method Detail

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

setReadAccessor

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

getRequiredDeclarations

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

getReadAccessor

public InternalReadAccessor getReadAccessor()

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

getEvaluator

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

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

isTemporal

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

Specified by:
isTemporal in interface Restriction
Returns:

getInterval

public Interval getInterval()

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 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.