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 void |
accumulate(Object workingMemoryContext,
Object context,
Tuple leftTuple,
InternalFactHandle handle,
WorkingMemory workingMemory)
Executes the accumulate (action) code for the given fact handle
|
abstract Accumulate |
clone()
Returns a clone from itself
|
abstract Object |
createContext() |
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 void |
init(Object workingMemoryContext,
Object context,
Tuple leftTuple,
WorkingMemory workingMemory)
Executes the initialization block of code
|
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) |
protected 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 void |
reverse(Object workingMemoryContext,
Object context,
Tuple leftTuple,
InternalFactHandle handle,
WorkingMemory workingMemory)
Executes the reverse (action) code for the given fact handle
|
abstract boolean |
supportsReverse()
Returns true if this accumulate supports reverse
|
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 Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public abstract Accumulator[] getAccumulators()
public abstract Object createContext()
public abstract void init(Object workingMemoryContext, Object context, Tuple leftTuple, WorkingMemory workingMemory)
public abstract void accumulate(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, WorkingMemory workingMemory)
public abstract void reverse(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, WorkingMemory workingMemory)
public abstract Object getResult(Object workingMemoryContext, Object context, Tuple leftTuple, WorkingMemory workingMemory)
public abstract boolean supportsReverse()
public abstract Accumulate clone()
RuleConditionElement
clone
in interface RuleConditionElement
clone
in class ConditionalElement
protected void registerClone(Accumulate clone)
public RuleConditionElement getSource()
public Map<String,Declaration> getInnerDeclarations()
RuleConditionElement
getInnerDeclarations
in interface RuleConditionElement
public Map<String,Declaration> getOuterDeclarations()
RuleConditionElement
getOuterDeclarations
in interface RuleConditionElement
public Declaration resolveDeclaration(String identifier)
RuleConditionElement
resolveDeclaration
in interface RuleConditionElement
public abstract Object createWorkingMemoryContext()
public List<RuleConditionElement> getNestedElements()
RuleConditionElement
getNestedElements
in interface RuleConditionElement
public boolean isPatternScopeDelimiter()
RuleConditionElement
isPatternScopeDelimiter
in interface RuleConditionElement
public abstract boolean isMultiFunction()
public void replaceDeclaration(Declaration declaration, Declaration resolved)
protected abstract void replaceAccumulatorDeclaration(Declaration declaration, Declaration resolved)
protected Declaration[] getInnerDeclarationCache()
public Declaration[] getRequiredDeclarations()
public boolean hasRequiredDeclarations()
public boolean requiresLeftActivation()
requiresLeftActivation
in interface PatternSource
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.