Package org.drools.base.rule
Class Accumulate
java.lang.Object
org.drools.base.rule.ConditionalElement
org.drools.base.rule.Accumulate
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,PatternSource,RuleComponent,RuleConditionElement
- Direct Known Subclasses:
MultiAccumulate,SingleAccumulate
A class to represent the Accumulate CE
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Accumulate>protected Declaration[]protected Declaration[]protected RuleConditionElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectaccumulate(Object workingMemoryContext, Object context, BaseTuple match, FactHandle handle, ValueResolver valueResolver) Executes the accumulate (action) code for the given fact handleabstract Objectaccumulate(Object workingMemoryContext, BaseTuple match, FactHandle childHandle, Object groupByContext, Object tupleList, ValueResolver valueResolver) abstract Accumulateclone()Returns a clone from itselfabstract Objectabstract Objectabstract Accumulator[]protected Declaration[]Returns a Map of declarations that are visible inside this conditional elementReturs a list of RuleConditionElement's that are nested inside the current elementReturns a Map of declarations that are visible outside this conditional element.abstract ObjectgetResult(Object workingMemoryContext, Object context, BaseTuple leftTuple, ValueResolver valueResolver) Gets the result of the accumulationbooleanabstract Objectinit(Object workingMemoryContext, Object accContext, Object funcContext, BaseTuple leftTuple, ValueResolver valueResolver) Executes the initialization block of codebooleanabstract booleanbooleanReturns true in case this RuleConditionElement delimits a pattern visibility scope.voidprotected voidregisterClone(Accumulate clone) abstract voidreplaceAccumulatorDeclaration(Declaration declaration, Declaration resolved) voidreplaceDeclaration(Declaration declaration, Declaration resolved) booleanresolveDeclaration(String identifier) Resolves the given identifier in the current scope and returns the Declaration object for the declaration.abstract booleanReturns true if this accumulate supports reverseabstract booleantryReverse(Object workingMemoryContext, Object context, BaseTuple leftTuple, FactHandle handle, BaseTuple match, ValueResolver valueResolver) Executes the reverse (action) code for the given fact handlevoid
-
Field Details
-
source
-
requiredDeclarations
-
innerDeclarationCache
-
cloned
-
-
Constructor Details
-
Accumulate
public Accumulate() -
Accumulate
-
-
Method Details
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
getAccumulators
-
createFunctionContext
-
init
public abstract Object init(Object workingMemoryContext, Object accContext, Object funcContext, BaseTuple leftTuple, ValueResolver valueResolver) Executes the initialization block of code -
accumulate
public abstract Object accumulate(Object workingMemoryContext, Object context, BaseTuple match, FactHandle handle, ValueResolver valueResolver) Executes the accumulate (action) code for the given fact handle -
tryReverse
public abstract boolean tryReverse(Object workingMemoryContext, Object context, BaseTuple leftTuple, FactHandle handle, BaseTuple match, ValueResolver valueResolver) Executes the reverse (action) code for the given fact handle -
getResult
public abstract Object getResult(Object workingMemoryContext, Object context, BaseTuple leftTuple, ValueResolver valueResolver) Gets the result of the accumulation -
supportsReverse
public abstract boolean supportsReverse()Returns true if this accumulate supports reverse -
clone
Description copied from interface:RuleConditionElementReturns a clone from itself- Specified by:
clonein interfaceRuleConditionElement- Specified by:
clonein classConditionalElement- Returns:
-
registerClone
-
getSource
-
getInnerDeclarations
Description copied from interface:RuleConditionElementReturns a Map of declarations that are visible inside this conditional element- Specified by:
getInnerDeclarationsin interfaceRuleConditionElement- Returns:
-
getOuterDeclarations
Description copied from interface:RuleConditionElementReturns a Map of declarations that are visible outside this conditional element.- Specified by:
getOuterDeclarationsin interfaceRuleConditionElement- Returns:
-
resolveDeclaration
Description copied from interface:RuleConditionElementResolves the given identifier in the current scope and returns the Declaration object for the declaration. Returns null if identifier can not be resolved.- Specified by:
resolveDeclarationin interfaceRuleConditionElement- Returns:
-
createWorkingMemoryContext
-
getNestedElements
Description copied from interface:RuleConditionElementReturs a list of RuleConditionElement's that are nested inside the current element- Specified by:
getNestedElementsin interfaceRuleConditionElement- Returns:
-
isPatternScopeDelimiter
public boolean isPatternScopeDelimiter()Description copied from interface:RuleConditionElementReturns true in case this RuleConditionElement delimits a pattern visibility scope. For instance, AND CE is not a scope delimiter, while NOT CE is a scope delimiter- Specified by:
isPatternScopeDelimiterin interfaceRuleConditionElement- Returns:
-
isMultiFunction
public abstract boolean isMultiFunction() -
replaceDeclaration
-
replaceAccumulatorDeclaration
-
getInnerDeclarationCache
-
getRequiredDeclarations
-
hasRequiredDeclarations
public boolean hasRequiredDeclarations() -
requiresLeftActivation
public boolean requiresLeftActivation()- Specified by:
requiresLeftActivationin interfacePatternSource
-
isGroupBy
public boolean isGroupBy() -
accumulate
public abstract Object accumulate(Object workingMemoryContext, BaseTuple match, FactHandle childHandle, Object groupByContext, Object tupleList, ValueResolver valueResolver)
-