public class Accumulate extends ConditionalElement implements PatternSource
Modifier and Type | Class and Description |
---|---|
class |
Accumulate.Wirer |
Constructor and Description |
---|
Accumulate() |
Accumulate(RuleConditionElement source) |
Accumulate(RuleConditionElement source,
Declaration[] requiredDeclarations) |
Accumulate(RuleConditionElement source,
Declaration[] requiredDeclarations,
Accumulator[] accumulators,
boolean multiFunction) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(Object[] workingMemoryContext,
Object[] context,
Tuple leftTuple,
InternalFactHandle handle,
WorkingMemory workingMemory)
Executes the accumulate (action) code for the given fact handle
|
Accumulate |
clone()
Returns a clone from itself
|
Serializable[] |
createContext() |
Object[] |
createWorkingMemoryContext() |
boolean |
equals(Object obj) |
Accumulator[] |
getAccumulators() |
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.
|
Object[] |
getResult(Object[] workingMemoryContext,
Object[] context,
Tuple leftTuple,
WorkingMemory workingMemory)
Gets the result of the accumulation
|
RuleConditionElement |
getSource() |
int |
hashCode() |
void |
init(Object[] workingMemoryContext,
Object[] context,
Tuple leftTuple,
WorkingMemory workingMemory)
Executes the initialization block of code
|
boolean |
isMultiFunction() |
boolean |
isPatternScopeDelimiter()
Returns true in case this RuleConditionElement delimits
a pattern visibility scope.
|
void |
readExternal(ObjectInput in) |
void |
replaceDeclaration(Declaration declaration,
Declaration resolved) |
void |
resetInnerDeclarationCache() |
Declaration |
resolveDeclaration(String identifier)
Resolves the given identifier in the current scope and
returns the Declaration object for the declaration.
|
void |
reverse(Object[] workingMemoryContext,
Object[] context,
Tuple leftTuple,
InternalFactHandle handle,
WorkingMemory workingMemory)
Executes the reverse (action) code for the given fact handle
|
void |
setAccumulators(Accumulator[] accumulators) |
void |
setMultiFunction(boolean multiFunction) |
boolean |
supportsReverse()
Returns true if this accumulate supports reverse
|
void |
writeExternal(ObjectOutput out) |
public Accumulate()
public Accumulate(RuleConditionElement source)
public Accumulate(RuleConditionElement source, Declaration[] requiredDeclarations)
public Accumulate(RuleConditionElement source, Declaration[] requiredDeclarations, Accumulator[] accumulators, boolean multiFunction)
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 Accumulator[] getAccumulators()
public void setAccumulators(Accumulator[] accumulators)
public Serializable[] createContext()
public void init(Object[] workingMemoryContext, Object[] context, Tuple leftTuple, WorkingMemory workingMemory)
leftTuple
- tuple causing the rule firedeclarations
- previous declarationsworkingMemory
- Exception
public void accumulate(Object[] workingMemoryContext, Object[] context, Tuple leftTuple, InternalFactHandle handle, WorkingMemory workingMemory)
leftTuple
- handle
- declarations
- localDeclarations
- workingMemory
- Exception
public void reverse(Object[] workingMemoryContext, Object[] context, Tuple leftTuple, InternalFactHandle handle, WorkingMemory workingMemory)
leftTuple
- handle
- declarations
- localDeclarations
- workingMemory
- Exception
public Object[] getResult(Object[] workingMemoryContext, Object[] context, Tuple leftTuple, WorkingMemory workingMemory)
leftTuple
- declarations
- workingMemory
- Exception
public boolean supportsReverse()
public Accumulate clone()
RuleConditionElement
clone
in interface RuleConditionElement
clone
in class ConditionalElement
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 Object[] createWorkingMemoryContext()
public List<RuleConditionElement> getNestedElements()
RuleConditionElement
getNestedElements
in interface RuleConditionElement
public boolean isPatternScopeDelimiter()
RuleConditionElement
isPatternScopeDelimiter
in interface RuleConditionElement
public boolean isMultiFunction()
public void setMultiFunction(boolean multiFunction)
multiFunction
- the multiFunction to setpublic void replaceDeclaration(Declaration declaration, Declaration resolved)
public void resetInnerDeclarationCache()
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.