org.drools.rule
Class Declaration

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

public class Declaration
extends Object
implements Externalizable, AcceptsReadAccessor, Cloneable

See Also:
Serialized Form

Constructor Summary
Declaration()
           
Declaration(String identifier, InternalReadAccessor extractor, Pattern pattern)
          Construct.
Declaration(String identifier, InternalReadAccessor extractor, Pattern pattern, boolean internalFact)
          Construct.
Declaration(String identifier, Pattern pattern)
          Construct.
 
Method Summary
 Object clone()
           
 boolean equals(Object object)
           
 boolean getBooleanValue(InternalWorkingMemory workingMemory, Object object)
           
 byte getByteValue(InternalWorkingMemory workingMemory, Object object)
           
 char getCharValue(InternalWorkingMemory workingMemory, Object object)
           
 double getDoubleValue(InternalWorkingMemory workingMemory, Object object)
           
 InternalReadAccessor getExtractor()
          Returns the Extractor expression
 float getFloatValue(InternalWorkingMemory workingMemory, Object object)
           
 int getHashCode(InternalWorkingMemory workingMemory, Object object)
           
 String getIdentifier()
          Retrieve the variable's identifier.
 int getIntValue(InternalWorkingMemory workingMemory, Object object)
           
 long getLongValue(InternalWorkingMemory workingMemory, Object object)
           
 Method getNativeReadMethod()
           
 Pattern getPattern()
          Returns the index of the pattern
 short getShortValue(InternalWorkingMemory workingMemory, Object object)
           
 Object getValue(InternalWorkingMemory workingMemory, Object object)
           
 ValueType getValueType()
          Retrieve the ValueType.
 int hashCode()
           
 boolean isGlobal()
           
 boolean isInternalFact()
           
 boolean isPatternDeclaration()
          Returns true if this declaration is a pattern declaration
 void readExternal(ObjectInput in)
           
 void setPattern(Pattern pattern)
           
 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

Declaration

public Declaration()

Declaration

public Declaration(String identifier,
                   Pattern pattern)
Construct.

Parameters:
identifier - The name of the variable.
objectType - The type of this variable declaration.
order - The index within a rule.

Declaration

public Declaration(String identifier,
                   InternalReadAccessor extractor,
                   Pattern pattern)
Construct.

Parameters:
identifier - The name of the variable.
objectType - The type of this variable declaration.
order - The index within a rule.

Declaration

public Declaration(String identifier,
                   InternalReadAccessor extractor,
                   Pattern pattern,
                   boolean internalFact)
Construct.

Parameters:
identifier - The name of the variable.
objectType - The type of this variable declaration.
order - The index within a rule.
internalFact - True if this is an internal fact created by the engine, like a collection result of a collect CE
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

getIdentifier

public String getIdentifier()
Retrieve the variable's identifier.

Returns:
The variable's identifier.

getValueType

public ValueType getValueType()
Retrieve the ValueType.

Returns:
The ValueType.

getPattern

public Pattern getPattern()
Returns the index of the pattern

Returns:
the pattern

setPattern

public void setPattern(Pattern pattern)

isPatternDeclaration

public boolean isPatternDeclaration()
Returns true if this declaration is a pattern declaration

Returns:

getExtractor

public InternalReadAccessor getExtractor()
Returns the Extractor expression

Returns:

getValue

public Object getValue(InternalWorkingMemory workingMemory,
                       Object object)

getCharValue

public char getCharValue(InternalWorkingMemory workingMemory,
                         Object object)

getIntValue

public int getIntValue(InternalWorkingMemory workingMemory,
                       Object object)

getByteValue

public byte getByteValue(InternalWorkingMemory workingMemory,
                         Object object)

getShortValue

public short getShortValue(InternalWorkingMemory workingMemory,
                           Object object)

getLongValue

public long getLongValue(InternalWorkingMemory workingMemory,
                         Object object)

getFloatValue

public float getFloatValue(InternalWorkingMemory workingMemory,
                           Object object)

getDoubleValue

public double getDoubleValue(InternalWorkingMemory workingMemory,
                             Object object)

getBooleanValue

public boolean getBooleanValue(InternalWorkingMemory workingMemory,
                               Object object)

getHashCode

public int getHashCode(InternalWorkingMemory workingMemory,
                       Object object)

isGlobal

public boolean isGlobal()

getNativeReadMethod

public Method getNativeReadMethod()

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

isInternalFact

public boolean isInternalFact()

clone

public Object clone()
Overrides:
clone in class Object


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