Package org.drools.core.reteoo
Class AccumulateNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.LeftTupleSource
-
- org.drools.core.reteoo.BetaNode
-
- org.drools.core.reteoo.AccumulateNode
-
- All Implemented Interfaces:
Externalizable
,Serializable
,MemoryFactory
,NetworkNode
,LeftTupleNode
,LeftTupleSink
,LeftTupleSinkNode
,ObjectSink
,ObjectSinkNode
,RightTupleSink
,Sink
public class AccumulateNode extends BetaNode
AccumulateNode A beta node capable of doing accumulate logic. Created: 04/06/2006- Version:
- $Id$
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccumulateNode.AccumulateContext
static class
AccumulateNode.AccumulateContextEntry
static class
AccumulateNode.AccumulateMemory
static interface
AccumulateNode.BaseAccumulation
static class
AccumulateNode.GroupByContext
static class
AccumulateNode.MultiAccumulateMemory
static class
AccumulateNode.SingleAccumulateMemory
-
Field Summary
Fields Modifier and Type Field Description protected Accumulate
accumulate
protected BetaConstraints
resultBinder
protected AlphaNodeFieldConstraint[]
resultConstraints
-
Fields inherited from class org.drools.core.reteoo.BetaNode
constraints, indexedUnificationJoin, isLogTraceEnabled, log, objectMemory, rightInput, rightInputIsRiaNode, tupleMemoryEnabled
-
Fields inherited from class org.drools.core.reteoo.LeftTupleSource
leftDeclaredMask, leftInferredMask, leftInput, leftNegativeMask, sink
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description AccumulateNode()
AccumulateNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, AlphaNodeFieldConstraint[] resultConstraints, BetaConstraints sourceBinder, BetaConstraints resultBinder, Accumulate accumulate, BuildContext context)
-
Method Summary
-
Methods inherited from class org.drools.core.reteoo.BetaNode
assertObject, byPassModifyToBetaNode, createRightTuple, doDeleteRightTuple, doUpdateRightTuple, dumpMemory, getBetaMemory, getBetaMemoryFromRightInput, getConstraints, getFirstLeftTuple, getFirstLeftTuple1, getFirstRightTuple, getFirstTuple, getLeftIterator, getLeftIterator1, getNextLeftTupleSinkNode, getNextObjectSinkNode, getObjectTypeNode, getPreviousLeftTupleSinkNode, getPreviousObjectSinkNode, getRawConstraints, getRightDeclaredMask, getRightInferredMask, getRightInput, getRightInputOtnId, getRightIterator, getRightIterator, getRightNegativeMask, getRules, getStartTuple, initDeclaredMask, initInferredMask, initInferredMask, isIndexedUnificationJoin, isLeftTupleMemoryEnabled, isObjectMemoryEnabled, isRightInputIsRiaNode, isRightInputPassive, modifyObject, networkUpdated, reorderRightTuple, setLeftListenedProperties, setLeftTupleMemoryEnabled, setNextLeftTupleSinkNode, setNextObjectSinkNode, setPartitionId, setPreviousLeftTupleSinkNode, setPreviousObjectSinkNode, setRightDeclaredMask, setRightInput, setRightInputOtnId, toString, unwrapRightInput
-
Methods inherited from class org.drools.core.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftInputPattern, getLeftNegativeMask, getLeftTupleSource, getObjectCount, getObjectType, getPathIndex, getSinkPropagator, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftTupleSource, setNodeConstraintsPropertyReactiveMask, setObjectCount, setPartitionIdWithSinks, setSourcePartitionId, setSourcePartitionId
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionsEnabled, setStreamMode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleNode
getLeftTupleSource, getObjectCount, getPathIndex, getSinkPropagator, setObjectCount
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleSink
getLeftInferredMask, getLeftInputOtnId, setLeftInputOtnId, setPartitionIdWithSinks
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.core.common.NetworkNode
getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, isAssociatedWith
-
Methods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
-
-
-
Field Detail
-
accumulate
protected Accumulate accumulate
-
resultConstraints
protected AlphaNodeFieldConstraint[] resultConstraints
-
resultBinder
protected BetaConstraints resultBinder
-
-
Constructor Detail
-
AccumulateNode
public AccumulateNode()
-
AccumulateNode
public AccumulateNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, AlphaNodeFieldConstraint[] resultConstraints, BetaConstraints sourceBinder, BetaConstraints resultBinder, Accumulate accumulate, BuildContext context)
-
-
Method Detail
-
getObjectTypeForPropertyReactivity
protected ObjectType getObjectTypeForPropertyReactivity(LeftInputAdapterNode leftInput, Pattern pattern)
- Overrides:
getObjectTypeForPropertyReactivity
in classLeftTupleSource
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classBetaNode
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classBetaNode
- Throws:
IOException
-
getType
public short getType()
- Specified by:
getType
in interfaceNetworkNode
- Specified by:
getType
in classLeftTupleSource
-
getAccumulate
public Accumulate getAccumulate()
-
getResultConstraints
public AlphaNodeFieldConstraint[] getResultConstraints()
-
getResultBinder
public BetaConstraints getResultBinder()
-
createResultFactHandle
public InternalFactHandle createResultFactHandle(PropagationContext context, InternalWorkingMemory workingMemory, LeftTuple leftTuple, Object result)
-
doAttach
public void doAttach(BuildContext context)
-
calculateHashCode
protected int calculateHashCode()
- Overrides:
calculateHashCode
in classBetaNode
-
createMemory
public Memory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
Creates a BetaMemory for the BetaNode's memory.- Specified by:
createMemory
in interfaceMemoryFactory
- Overrides:
createMemory
in classBetaNode
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, boolean leftTupleMemoryEnabled)
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, Sink sink)
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, Sink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, Sink sink)
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, Sink sink, boolean leftTupleMemoryEnabled)
-
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeer
in interfaceLeftTupleSink
- Specified by:
createPeer
in classLeftTupleSource
-
retractRightTuple
public void retractRightTuple(RightTuple rightTuple, PropagationContext pctx, InternalWorkingMemory workingMemory)
-
modifyRightTuple
public void modifyRightTuple(RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory)
-
doRemove
public boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
-
-