Package org.drools.core.rule
Class SingleAccumulate
- java.lang.Object
-
- org.drools.core.rule.ConditionalElement
-
- org.drools.core.rule.Accumulate
-
- org.drools.core.rule.SingleAccumulate
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,PatternSource
,RuleConditionElement
,RuleComponent
public class SingleAccumulate extends Accumulate
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SingleAccumulate.Wirer
-
Field Summary
-
Fields inherited from class org.drools.core.rule.Accumulate
cloned, innerDeclarationCache, requiredDeclarations, source
-
-
Constructor Summary
Constructors Constructor Description SingleAccumulate()
SingleAccumulate(RuleConditionElement source, Declaration[] requiredDeclarations)
SingleAccumulate(RuleConditionElement source, Declaration[] requiredDeclarations, Accumulator accumulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
accumulate(Object workingMemoryContext, Object context, Tuple match, InternalFactHandle handle, WorkingMemory workingMemory)
Executes the accumulate (action) code for the given fact handleObject
accumulate(Object workingMemoryContext, Tuple match, InternalFactHandle childHandle, AccumulateNode.GroupByContext groupByContext, TupleList<AccumulateNode.AccumulateContextEntry> tupleList, WorkingMemory wm)
SingleAccumulate
clone()
Returns a clone from itselfObject
createFunctionContext()
Object
createWorkingMemoryContext()
boolean
equals(Object obj)
Accumulator[]
getAccumulators()
Object
getResult(Object workingMemoryContext, Object context, Tuple leftTuple, WorkingMemory workingMemory)
Gets the result of the accumulationint
hashCode()
Object
init(Object workingMemoryContext, Object accContext, Object funcContext, Tuple leftTuple, WorkingMemory workingMemory)
Executes the initialization block of codeboolean
isMultiFunction()
void
readExternal(ObjectInput in)
void
replaceAccumulatorDeclaration(Declaration declaration, Declaration resolved)
boolean
supportsReverse()
Returns true if this accumulate supports reverseboolean
tryReverse(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, RightTuple rightParent, LeftTuple match, WorkingMemory workingMemory)
Executes the reverse (action) code for the given fact handlevoid
writeExternal(ObjectOutput out)
-
Methods inherited from class org.drools.core.rule.Accumulate
getInnerDeclarationCache, getInnerDeclarations, getNestedElements, getOuterDeclarations, getRequiredDeclarations, getSource, hasRequiredDeclarations, isGroupBy, isPatternScopeDelimiter, registerClone, replaceDeclaration, requiresLeftActivation, resolveDeclaration
-
-
-
-
Constructor Detail
-
SingleAccumulate
public SingleAccumulate()
-
SingleAccumulate
public SingleAccumulate(RuleConditionElement source, Declaration[] requiredDeclarations)
-
SingleAccumulate
public SingleAccumulate(RuleConditionElement source, Declaration[] requiredDeclarations, Accumulator accumulator)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classAccumulate
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classAccumulate
- Throws:
IOException
-
isMultiFunction
public boolean isMultiFunction()
- Specified by:
isMultiFunction
in classAccumulate
-
getAccumulators
public Accumulator[] getAccumulators()
- Specified by:
getAccumulators
in classAccumulate
-
createFunctionContext
public Object createFunctionContext()
- Specified by:
createFunctionContext
in classAccumulate
-
init
public Object init(Object workingMemoryContext, Object accContext, Object funcContext, Tuple leftTuple, WorkingMemory workingMemory)
Description copied from class:Accumulate
Executes the initialization block of code- Specified by:
init
in classAccumulate
-
accumulate
public Object accumulate(Object workingMemoryContext, Object context, Tuple match, InternalFactHandle handle, WorkingMemory workingMemory)
Description copied from class:Accumulate
Executes the accumulate (action) code for the given fact handle- Specified by:
accumulate
in classAccumulate
-
accumulate
public Object accumulate(Object workingMemoryContext, Tuple match, InternalFactHandle childHandle, AccumulateNode.GroupByContext groupByContext, TupleList<AccumulateNode.AccumulateContextEntry> tupleList, WorkingMemory wm)
- Specified by:
accumulate
in classAccumulate
-
tryReverse
public boolean tryReverse(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, RightTuple rightParent, LeftTuple match, WorkingMemory workingMemory)
Description copied from class:Accumulate
Executes the reverse (action) code for the given fact handle- Specified by:
tryReverse
in classAccumulate
-
supportsReverse
public boolean supportsReverse()
Description copied from class:Accumulate
Returns true if this accumulate supports reverse- Specified by:
supportsReverse
in classAccumulate
-
getResult
public Object getResult(Object workingMemoryContext, Object context, Tuple leftTuple, WorkingMemory workingMemory)
Description copied from class:Accumulate
Gets the result of the accumulation- Specified by:
getResult
in classAccumulate
-
clone
public SingleAccumulate clone()
Description copied from interface:RuleConditionElement
Returns a clone from itself- Specified by:
clone
in interfaceRuleConditionElement
- Specified by:
clone
in classAccumulate
- Returns:
-
replaceAccumulatorDeclaration
public void replaceAccumulatorDeclaration(Declaration declaration, Declaration resolved)
- Specified by:
replaceAccumulatorDeclaration
in classAccumulate
-
createWorkingMemoryContext
public Object createWorkingMemoryContext()
- Specified by:
createWorkingMemoryContext
in classAccumulate
-
-