Package org.drools.core.rule
Class Declaration
- java.lang.Object
-
- org.drools.core.rule.Declaration
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Acceptor
,AcceptsReadAccessor
,TupleValueExtractor
public class Declaration extends Object implements Externalizable, AcceptsReadAccessor, TupleValueExtractor
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Declaration()
Declaration(String identifier, Pattern pattern)
Construct.Declaration(String identifier, InternalReadAccessor extractor, Pattern pattern)
Construct.Declaration(String identifier, InternalReadAccessor extractor, Pattern pattern, boolean internalFact)
Construct.
-
Method Summary
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.spi.TupleValueExtractor
cloneWithPattern, getValue
-
-
-
-
Constructor Detail
-
Declaration
public Declaration()
-
Declaration
public Declaration(String identifier, Pattern pattern)
Construct.- Parameters:
identifier
- The name of the variable.pattern
- The pattern this variable is declared in
-
Declaration
public Declaration(String identifier, InternalReadAccessor extractor, Pattern pattern)
Construct.- Parameters:
identifier
- The name of the variable.extractor
- The extractor for this variablepattern
- The pattern this variable is declared in
-
Declaration
public Declaration(String identifier, InternalReadAccessor extractor, Pattern pattern, boolean internalFact)
Construct.- Parameters:
identifier
- The name of the variable.identifier
- The name of the variable.extractor
- The extractor for this variableinternalFact
- 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 interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
getIdentifier
public String getIdentifier()
Retrieve the variable's identifier.- Returns:
- The variable's identifier.
-
getBindingName
public String getBindingName()
-
setBindingName
public void setBindingName(String bindingName)
-
getValueType
public ValueType getValueType()
Retrieve theValueType
.- Specified by:
getValueType
in interfaceTupleValueExtractor
- Returns:
- The ValueType.
-
getPattern
public Pattern getPattern()
Returns the index of the pattern- Returns:
- the pattern
-
setPattern
public void setPattern(Pattern pattern)
-
getObjectIndex
public int getObjectIndex()
-
getTupleIndex
public int getTupleIndex()
-
setxPathOffset
public void setxPathOffset(int xPathOffset)
-
getxPathOffset
public int getxPathOffset()
-
isFromXpathChunk
public boolean isFromXpathChunk()
-
isPatternDeclaration
public boolean isPatternDeclaration()
Returns true if this declaration is a pattern declaration
-
setReadAccessor
public void setReadAccessor(InternalReadAccessor readAccessor)
- Specified by:
setReadAccessor
in interfaceAcceptsReadAccessor
-
getExtractor
public InternalReadAccessor getExtractor()
Returns the Extractor expression
-
getDeclarationClass
public Class<?> getDeclarationClass()
-
setDeclarationClass
public void setDeclarationClass(Class<?> declarationClass)
-
getValue
public Object getValue(InternalWorkingMemory workingMemory, Tuple tuple)
- Specified by:
getValue
in interfaceTupleValueExtractor
-
getValue
public Object getValue(InternalWorkingMemory workingMemory, InternalFactHandle fh)
-
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()
-
getNativeReadMethodName
public String getNativeReadMethodName()
-
getTypeName
public String getTypeName()
-
getBoxedTypeName
public String getBoxedTypeName()
-
isInternalFact
public boolean isInternalFact()
-
clone
public Declaration clone()
- Specified by:
clone
in interfaceTupleValueExtractor
- Overrides:
clone
in classObject
-
cloneWithPattern
public Declaration cloneWithPattern(Pattern pattern)
-
-