public abstract class Accumulate extends ConditionalElement implements PatternSource
| Modifier and Type | Field and Description |
|---|---|
protected List<Accumulate> |
cloned |
protected Declaration[] |
innerDeclarationCache |
protected Declaration[] |
requiredDeclarations |
protected RuleConditionElement |
source |
| Constructor and Description |
|---|
Accumulate() |
Accumulate(RuleConditionElement source,
Declaration[] requiredDeclarations) |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
accumulate(Object workingMemoryContext,
Object context,
Tuple match,
InternalFactHandle handle,
WorkingMemory workingMemory)
Executes the accumulate (action) code for the given fact handle
|
abstract Object |
accumulate(Object workingMemoryContext,
Tuple match,
InternalFactHandle childHandle,
AccumulateNode.GroupByContext groupByContext,
TupleList<AccumulateNode.AccumulateContextEntry> tupleList,
WorkingMemory wm) |
abstract Accumulate |
clone()
Returns a clone from itself
|
abstract Object |
createFunctionContext() |
abstract Object |
createWorkingMemoryContext() |
abstract Accumulator[] |
getAccumulators() |
protected Declaration[] |
getInnerDeclarationCache() |
Map<String,Declaration> |
getInnerDeclarations()
Returns a Map of declarations that are
visible inside this conditional element
|
List<RuleConditionElement> |
getNestedElements()
Returs a list of RuleConditionElement's that are nested
inside the current element
|
Map<String,Declaration> |
getOuterDeclarations()
Returns a Map of declarations that are visible
outside this conditional element.
|
Declaration[] |
getRequiredDeclarations() |
abstract Object |
getResult(Object workingMemoryContext,
Object context,
Tuple leftTuple,
WorkingMemory workingMemory)
Gets the result of the accumulation
|
RuleConditionElement |
getSource() |
boolean |
hasRequiredDeclarations() |
abstract Object |
init(Object workingMemoryContext,
Object accContext,
Object funcContext,
Tuple leftTuple,
WorkingMemory workingMemory)
Executes the initialization block of code
|
boolean |
isGroupBy() |
abstract boolean |
isMultiFunction() |
boolean |
isPatternScopeDelimiter()
Returns true in case this RuleConditionElement delimits
a pattern visibility scope.
|
void |
readExternal(ObjectInput in) |
protected void |
registerClone(Accumulate clone) |
abstract void |
replaceAccumulatorDeclaration(Declaration declaration,
Declaration resolved) |
void |
replaceDeclaration(Declaration declaration,
Declaration resolved) |
boolean |
requiresLeftActivation() |
Declaration |
resolveDeclaration(String identifier)
Resolves the given identifier in the current scope and
returns the Declaration object for the declaration.
|
abstract boolean |
supportsReverse()
Returns true if this accumulate supports reverse
|
abstract boolean |
tryReverse(Object workingMemoryContext,
Object context,
Tuple leftTuple,
InternalFactHandle handle,
RightTuple rightParent,
LeftTuple match,
WorkingMemory workingMemory)
Executes the reverse (action) code for the given fact handle
|
void |
writeExternal(ObjectOutput out) |
protected RuleConditionElement source
protected Declaration[] requiredDeclarations
protected Declaration[] innerDeclarationCache
protected List<Accumulate> cloned
public Accumulate()
public Accumulate(RuleConditionElement source, Declaration[] requiredDeclarations)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic abstract Accumulator[] getAccumulators()
public abstract Object createFunctionContext()
public abstract Object init(Object workingMemoryContext, Object accContext, Object funcContext, Tuple leftTuple, WorkingMemory workingMemory)
public abstract Object accumulate(Object workingMemoryContext, Object context, Tuple match, InternalFactHandle handle, WorkingMemory workingMemory)
public abstract boolean tryReverse(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, RightTuple rightParent, LeftTuple match, WorkingMemory workingMemory)
public abstract Object getResult(Object workingMemoryContext, Object context, Tuple leftTuple, WorkingMemory workingMemory)
public abstract boolean supportsReverse()
public abstract Accumulate clone()
RuleConditionElementclone in interface RuleConditionElementclone in class ConditionalElementprotected void registerClone(Accumulate clone)
public RuleConditionElement getSource()
public Map<String,Declaration> getInnerDeclarations()
RuleConditionElementgetInnerDeclarations in interface RuleConditionElementpublic Map<String,Declaration> getOuterDeclarations()
RuleConditionElementgetOuterDeclarations in interface RuleConditionElementpublic Declaration resolveDeclaration(String identifier)
RuleConditionElementresolveDeclaration in interface RuleConditionElementpublic abstract Object createWorkingMemoryContext()
public List<RuleConditionElement> getNestedElements()
RuleConditionElementgetNestedElements in interface RuleConditionElementpublic boolean isPatternScopeDelimiter()
RuleConditionElementisPatternScopeDelimiter in interface RuleConditionElementpublic abstract boolean isMultiFunction()
public void replaceDeclaration(Declaration declaration, Declaration resolved)
public abstract void replaceAccumulatorDeclaration(Declaration declaration, Declaration resolved)
protected Declaration[] getInnerDeclarationCache()
public Declaration[] getRequiredDeclarations()
public boolean hasRequiredDeclarations()
public boolean requiresLeftActivation()
requiresLeftActivation in interface PatternSourcepublic boolean isGroupBy()
public abstract Object accumulate(Object workingMemoryContext, Tuple match, InternalFactHandle childHandle, AccumulateNode.GroupByContext groupByContext, TupleList<AccumulateNode.AccumulateContextEntry> tupleList, WorkingMemory wm)
Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.