org.drools.rule
Class LiteralRestriction

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

public class LiteralRestriction
extends Object
implements Restriction, Externalizable

See Also:
Serialized Form

Constructor Summary
LiteralRestriction()
           
LiteralRestriction(FieldValue field, Evaluator evaluator, InternalReadAccessor fieldExtractor)
           
 
Method Summary
 Object clone()
           
 ContextEntry createContextEntry()
           
 boolean equals(Object object)
           
 Evaluator getEvaluator()
           
 FieldValue getField()
           
 Declaration[] getRequiredDeclarations()
          Literal constraints cannot have required declarations, so always return an empty array.
 int hashCode()
           
 boolean isAllowed(InternalReadAccessor readAccessor, 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
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiteralRestriction

public LiteralRestriction()

LiteralRestriction

public LiteralRestriction(FieldValue field,
                          Evaluator evaluator,
                          InternalReadAccessor fieldExtractor)
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

getEvaluator

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

getField

public FieldValue getField()

isAllowed

public boolean isAllowed(InternalReadAccessor readAccessor,
                         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

getRequiredDeclarations

public Declaration[] getRequiredDeclarations()
Literal constraints cannot have required declarations, so always return an empty array.

Specified by:
getRequiredDeclarations in interface Restriction
Returns:
Return an empty Declaration[]

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

isTemporal

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

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 Restriction

clone

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


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