Package org.drools.base.rule
Class SingleAccumulate
- java.lang.Object
-
- org.drools.base.rule.ConditionalElement
-
- org.drools.base.rule.Accumulate
-
- org.drools.base.rule.SingleAccumulate
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,PatternSource,RuleComponent,RuleConditionElement
public class SingleAccumulate extends Accumulate
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSingleAccumulate.Wirer
-
Field Summary
-
Fields inherited from class org.drools.base.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 java.lang.Objectaccumulate(java.lang.Object workingMemoryContext, java.lang.Object context, BaseTuple match, org.kie.api.runtime.rule.FactHandle handle, ValueResolver valueResolver)Executes the accumulate (action) code for the given fact handlejava.lang.Objectaccumulate(java.lang.Object workingMemoryContext, BaseTuple match, org.kie.api.runtime.rule.FactHandle childHandle, java.lang.Object groupByContext, java.lang.Object tupleList, ValueResolver valueResolver)SingleAccumulateclone()Returns a clone from itselfjava.lang.ObjectcreateFunctionContext()java.lang.ObjectcreateWorkingMemoryContext()booleanequals(java.lang.Object obj)Accumulator[]getAccumulators()java.lang.ObjectgetResult(java.lang.Object workingMemoryContext, java.lang.Object context, BaseTuple leftTuple, ValueResolver valueResolver)Gets the result of the accumulationinthashCode()java.lang.Objectinit(java.lang.Object workingMemoryContext, java.lang.Object accContext, java.lang.Object funcContext, BaseTuple leftTuple, ValueResolver valueResolver)Executes the initialization block of codebooleanisMultiFunction()voidreadExternal(java.io.ObjectInput in)voidreplaceAccumulatorDeclaration(Declaration declaration, Declaration resolved)booleansupportsReverse()Returns true if this accumulate supports reversebooleantryReverse(java.lang.Object workingMemoryContext, java.lang.Object context, BaseTuple leftTuple, org.kie.api.runtime.rule.FactHandle handle, BaseTuple match, ValueResolver valueResolver)Executes the reverse (action) code for the given fact handlevoidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class org.drools.base.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(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Overrides:
readExternalin classAccumulate- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Overrides:
writeExternalin classAccumulate- Throws:
java.io.IOException
-
isMultiFunction
public boolean isMultiFunction()
- Specified by:
isMultiFunctionin classAccumulate
-
getAccumulators
public Accumulator[] getAccumulators()
- Specified by:
getAccumulatorsin classAccumulate
-
createFunctionContext
public java.lang.Object createFunctionContext()
- Specified by:
createFunctionContextin classAccumulate
-
init
public java.lang.Object init(java.lang.Object workingMemoryContext, java.lang.Object accContext, java.lang.Object funcContext, BaseTuple leftTuple, ValueResolver valueResolver)Description copied from class:AccumulateExecutes the initialization block of code- Specified by:
initin classAccumulate
-
accumulate
public java.lang.Object accumulate(java.lang.Object workingMemoryContext, java.lang.Object context, BaseTuple match, org.kie.api.runtime.rule.FactHandle handle, ValueResolver valueResolver)Description copied from class:AccumulateExecutes the accumulate (action) code for the given fact handle- Specified by:
accumulatein classAccumulate
-
accumulate
public java.lang.Object accumulate(java.lang.Object workingMemoryContext, BaseTuple match, org.kie.api.runtime.rule.FactHandle childHandle, java.lang.Object groupByContext, java.lang.Object tupleList, ValueResolver valueResolver)- Specified by:
accumulatein classAccumulate
-
tryReverse
public boolean tryReverse(java.lang.Object workingMemoryContext, java.lang.Object context, BaseTuple leftTuple, org.kie.api.runtime.rule.FactHandle handle, BaseTuple match, ValueResolver valueResolver)Description copied from class:AccumulateExecutes the reverse (action) code for the given fact handle- Specified by:
tryReversein classAccumulate
-
supportsReverse
public boolean supportsReverse()
Description copied from class:AccumulateReturns true if this accumulate supports reverse- Specified by:
supportsReversein classAccumulate
-
getResult
public java.lang.Object getResult(java.lang.Object workingMemoryContext, java.lang.Object context, BaseTuple leftTuple, ValueResolver valueResolver)Description copied from class:AccumulateGets the result of the accumulation- Specified by:
getResultin classAccumulate
-
clone
public SingleAccumulate clone()
Description copied from interface:RuleConditionElementReturns a clone from itself- Specified by:
clonein interfaceRuleConditionElement- Specified by:
clonein classAccumulate- Returns:
-
replaceAccumulatorDeclaration
public void replaceAccumulatorDeclaration(Declaration declaration, Declaration resolved)
- Specified by:
replaceAccumulatorDeclarationin classAccumulate
-
createWorkingMemoryContext
public java.lang.Object createWorkingMemoryContext()
- Specified by:
createWorkingMemoryContextin classAccumulate
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-