Class CollectAccumulator
- java.lang.Object
-
- org.drools.core.base.accumulators.CollectAccumulator
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,Accumulator,Invoker,RuleComponent
public class CollectAccumulator extends java.lang.Object implements Accumulator, java.io.Externalizable
An accumulator to execute "collect" CEs- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CollectAccumulator()CollectAccumulator(Collect collect, boolean unwrapHandle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccumulate(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, InternalFactHandle handle, Declaration[] declarations, Declaration[] innerDeclarations, ReteEvaluator reteEvaluator)Executes the accumulate (action) code for the given fact handlejava.lang.ObjectcreateContext()Creates the context object for an accumulator session.java.lang.ObjectcreateWorkingMemoryContext()Creates and return a context object for each working memory instancejava.lang.ObjectgetResult(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, Declaration[] declarations, ReteEvaluator reteEvaluator)Gets the result of the accummulationjava.lang.Objectinit(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, Declaration[] declarations, ReteEvaluator reteEvaluator)Executes the initialization block of codevoidreadExternal(java.io.ObjectInput in)booleansupportsReverse()Returns true if this accumulator supports operation reversalbooleantryReverse(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, InternalFactHandle handle, java.lang.Object value, Declaration[] declarations, Declaration[] innerDeclarations, ReteEvaluator reteEvaluator)Reverses the accumulate action for the given fact handlevoidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.drools.core.rule.accessor.Accumulator
getRequiredDeclarations, replaceDeclaration
-
Methods inherited from interface org.drools.core.rule.accessor.Invoker
wrapsCompiledInvoker
-
-
-
-
Constructor Detail
-
CollectAccumulator
public CollectAccumulator()
-
CollectAccumulator
public CollectAccumulator(Collect collect, boolean unwrapHandle)
-
-
Method Detail
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
createContext
public java.lang.Object createContext()
Description copied from interface:AccumulatorCreates the context object for an accumulator session. The context is passed as a parameter to every subsequent accumulator method call in the same session.- Specified by:
createContextin interfaceAccumulator- Returns:
-
init
public java.lang.Object init(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, Declaration[] declarations, ReteEvaluator reteEvaluator)Description copied from interface:AccumulatorExecutes the initialization block of code- Specified by:
initin interfaceAccumulatorleftTuple- tuple causing the rule firedeclarations- previous declarations
-
accumulate
public java.lang.Object accumulate(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, InternalFactHandle handle, Declaration[] declarations, Declaration[] innerDeclarations, ReteEvaluator reteEvaluator)Description copied from interface:AccumulatorExecutes the accumulate (action) code for the given fact handle- Specified by:
accumulatein interfaceAccumulator
-
tryReverse
public boolean tryReverse(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, InternalFactHandle handle, java.lang.Object value, Declaration[] declarations, Declaration[] innerDeclarations, ReteEvaluator reteEvaluator)Description copied from interface:AccumulatorReverses the accumulate action for the given fact handle- Specified by:
tryReversein interfaceAccumulator
-
getResult
public java.lang.Object getResult(java.lang.Object workingMemoryContext, java.lang.Object context, Tuple leftTuple, Declaration[] declarations, ReteEvaluator reteEvaluator)Description copied from interface:AccumulatorGets the result of the accummulation- Specified by:
getResultin interfaceAccumulator- Returns:
-
supportsReverse
public boolean supportsReverse()
Description copied from interface:AccumulatorReturns true if this accumulator supports operation reversal- Specified by:
supportsReversein interfaceAccumulator- Returns:
-
createWorkingMemoryContext
public java.lang.Object createWorkingMemoryContext()
Description copied from interface:AccumulatorCreates and return a context object for each working memory instance- Specified by:
createWorkingMemoryContextin interfaceAccumulator- Returns:
-
-