Drools :: Core 6.1.0.Beta1

org.drools.core.reteoo
Class AccumulateNode

java.lang.Object
  extended by org.drools.core.common.BaseNode
      extended by org.drools.core.reteoo.LeftTupleSource
          extended by org.drools.core.reteoo.BetaNode
              extended by org.drools.core.reteoo.AccumulateNode
All Implemented Interfaces:
Externalizable, Serializable, MemoryFactory, NetworkNode, 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
static class AccumulateNode.AccumulateContext
           
static class AccumulateNode.AccumulateMemory
           
static class AccumulateNode.ActivitySource
           
 
Field Summary
protected  Accumulate accumulate
           
protected  BetaConstraints resultBinder
           
protected  AlphaNodeFieldConstraint[] resultConstraints
           
protected  boolean unwrapRightObject
           
 
Fields inherited from class org.drools.core.reteoo.BetaNode
concurrentRightTupleMemory, constraints, indexedUnificationJoin, log, objectMemory, rightInput, tupleMemoryEnabled
 
Fields inherited from class org.drools.core.reteoo.LeftTupleSource
leftInput, sink
 
Fields inherited from class org.drools.core.common.BaseNode
associations, id, partitionId, partitionsEnabled, streamMode
 
Constructor Summary
AccumulateNode()
           
AccumulateNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, AlphaNodeFieldConstraint[] resultConstraints, BetaConstraints sourceBinder, BetaConstraints resultBinder, Accumulate accumulate, boolean unwrapRightObject, BuildContext context)
           
 
Method Summary
 void assertLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
          Assert a new ReteTuple.
 void assertRightTuple(RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, LeftTupleSink sink)
           
 LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, LeftTupleSink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTupleSink sink)
           
 Memory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
          Creates a BetaMemory for the BetaNode's memory.
 LeftTuple createPeer(LeftTuple original)
           
 InternalFactHandle createResultFactHandle(PropagationContext context, InternalWorkingMemory workingMemory, LeftTuple leftTuple, Object result)
           
 void doRemove(InternalWorkingMemory workingMemory, AccumulateNode.AccumulateMemory object)
           
 void doRemove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories)
          Removes the node from teh network.
 boolean equals(Object object)
           
 Accumulate getAccumulate()
           
 BetaConstraints getResultBinder()
           
 AlphaNodeFieldConstraint[] getResultConstraints()
           
 short getType()
           
 int hashCode()
          The hashCode return is simply the unique id of the node.
 boolean isUnwrapRightObject()
           
 void modifyLeftTuple(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void modifyLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void modifyRightTuple(RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void readExternal(ObjectInput in)
           
 void retractLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void retractRightTuple(RightTuple rightTuple, PropagationContext pctx, InternalWorkingMemory workingMemory)
           
 void updateSink(LeftTupleSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.drools.core.reteoo.BetaNode
assertObject, attach, byPassModifyToBetaNode, createRightTuple, doDeleteRightTuple, doUpdateRightTuple, dumpMemory, getBetaMemory, getBetaMemoryFromRightInput, getConstraints, getFirstLeftTuple, getFirstLeftTuple, getFirstRightTuple, getFirstRightTuple, getLeftIterator, getLeftTupleSource, getNextLeftTupleSinkNode, getNextObjectSinkNode, getObjectTypeNode, getPreviousLeftTupleSinkNode, getPreviousObjectSinkNode, getRawConstraints, getRightDeclaredMask, getRightInferredMask, getRightInput, getRightInputOtnId, getRightIterator, getRightIterator, getRightNegativeMask, getRules, initDeclaredMask, initInferredMask, initInferredMask, isConcurrentRightTupleMemory, isIndexedUnificationJoin, isLeftTupleMemoryEnabled, isObjectMemoryEnabled, isRightInputIsRiaNode, modifyObject, networkUpdated, setConcurrentRightTupleMemory, setConstraints, setLeftListenedProperties, setLeftTupleMemoryEnabled, setNextLeftTupleSinkNode, setNextObjectSinkNode, setObjectMemoryEnabled, setPreviousLeftTupleSinkNode, setPreviousObjectSinkNode, setRightDeclaredMask, setRightInputOtnId, setUnificationJoin, toString, unwrapRightInput
 
Methods inherited from class org.drools.core.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftNegativeMask, getObjectType, getSinkPropagator, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftTupleSource
 
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, attach, getAssociations, getId, getPartitionId, isStreamMode, remove, removeAssociation, setId, setPartitionId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.core.reteoo.LeftTupleSink
getLeftInferredMask, getLeftInputOtnId, setLeftInputOtnId
 
Methods inherited from interface org.drools.core.common.NetworkNode
getAssociations, getId, getPartitionId
 
Methods inherited from interface org.drools.core.common.MemoryFactory
getId
 

Field Detail

unwrapRightObject

protected boolean unwrapRightObject

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,
                      boolean unwrapRightObject,
                      BuildContext context)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class BetaNode
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class BetaNode
Throws:
IOException

getType

public short getType()
Specified by:
getType in interface NetworkNode
Specified by:
getType in interface LeftTupleSink
Specified by:
getType in interface RightTupleSink
Specified by:
getType in class LeftTupleSource

getAccumulate

public Accumulate getAccumulate()

getResultConstraints

public AlphaNodeFieldConstraint[] getResultConstraints()

getResultBinder

public BetaConstraints getResultBinder()

isUnwrapRightObject

public boolean isUnwrapRightObject()

createResultFactHandle

public InternalFactHandle createResultFactHandle(PropagationContext context,
                                                 InternalWorkingMemory workingMemory,
                                                 LeftTuple leftTuple,
                                                 Object result)

hashCode

public int hashCode()
Description copied from class: BaseNode
The hashCode return is simply the unique id of the node. It is expected that base classes will also implement equals(Object object).

Overrides:
hashCode in class BetaNode

equals

public boolean equals(Object object)
Overrides:
equals in class BetaNode

createMemory

public Memory createMemory(RuleBaseConfiguration config,
                           InternalWorkingMemory wm)
Creates a BetaMemory for the BetaNode's memory.

Specified by:
createMemory in interface MemoryFactory
Overrides:
createMemory in class BetaNode

doRemove

public void doRemove(InternalWorkingMemory workingMemory,
                     AccumulateNode.AccumulateMemory object)

createLeftTuple

public LeftTuple createLeftTuple(InternalFactHandle factHandle,
                                 LeftTupleSink sink,
                                 boolean leftTupleMemoryEnabled)

createLeftTuple

public LeftTuple createLeftTuple(InternalFactHandle factHandle,
                                 LeftTuple leftTuple,
                                 LeftTupleSink sink)

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 LeftTupleSink sink,
                                 PropagationContext pctx,
                                 boolean leftTupleMemoryEnabled)

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 RightTuple rightTuple,
                                 LeftTupleSink sink)

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 RightTuple rightTuple,
                                 LeftTuple currentLeftChild,
                                 LeftTuple currentRightChild,
                                 LeftTupleSink sink,
                                 boolean leftTupleMemoryEnabled)

createPeer

public LeftTuple createPeer(LeftTuple original)
Specified by:
createPeer in interface LeftTupleSink
Specified by:
createPeer in class LeftTupleSource

assertRightTuple

public void assertRightTuple(RightTuple rightTuple,
                             PropagationContext context,
                             InternalWorkingMemory workingMemory)

retractRightTuple

public void retractRightTuple(RightTuple rightTuple,
                              PropagationContext pctx,
                              InternalWorkingMemory workingMemory)

modifyRightTuple

public void modifyRightTuple(RightTuple rightTuple,
                             PropagationContext context,
                             InternalWorkingMemory workingMemory)

assertLeftTuple

public void assertLeftTuple(LeftTuple leftTuple,
                            PropagationContext context,
                            InternalWorkingMemory workingMemory)
Description copied from interface: LeftTupleSink
Assert a new ReteTuple.

Parameters:
leftTuple - The ReteTuple to propagate.
context - The PropagationContext of the WorkingMemory action
workingMemory - the WorkingMemory session.

retractLeftTuple

public void retractLeftTuple(LeftTuple leftTuple,
                             PropagationContext context,
                             InternalWorkingMemory workingMemory)

modifyLeftTuple

public void modifyLeftTuple(InternalFactHandle factHandle,
                            ModifyPreviousTuples modifyPreviousTuples,
                            PropagationContext context,
                            InternalWorkingMemory workingMemory)

modifyLeftTuple

public void modifyLeftTuple(LeftTuple leftTuple,
                            PropagationContext context,
                            InternalWorkingMemory workingMemory)

updateSink

public void updateSink(LeftTupleSink sink,
                       PropagationContext context,
                       InternalWorkingMemory workingMemory)
Specified by:
updateSink in class LeftTupleSource

doRemove

public void doRemove(RuleRemovalContext context,
                     ReteooBuilder builder,
                     InternalWorkingMemory[] workingMemories)
Description copied from class: BaseNode
Removes the node from teh network. Usually from the parent ObjectSource or TupleSource

Specified by:
doRemove in class BaseNode

Drools :: Core 6.1.0.Beta1

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.