org.drools.reteoo
Class AccumulateNode

java.lang.Object
  extended by org.drools.common.BaseNode
      extended by org.drools.reteoo.LeftTupleSource
          extended by org.drools.reteoo.BetaNode
              extended by org.drools.reteoo.AccumulateNode
All Implemented Interfaces:
Externalizable, Serializable, NetworkNode, NodeMemory, 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
 
Fields inherited from class org.drools.reteoo.BetaNode
behavior, concurrentRightTupleMemory, constraints, leftInput, lrUnlinkingEnabled, objectMemory, rightInput, tupleMemoryEnabled
 
Fields inherited from class org.drools.reteoo.LeftTupleSource
sink
 
Fields inherited from class org.drools.common.BaseNode
associations, id, partitionId, partitionsEnabled
 
Constructor Summary
AccumulateNode()
           
AccumulateNode(int id, LeftTupleSource leftInput, ObjectSource rightInput, AlphaNodeFieldConstraint[] resultConstraints, BetaConstraints sourceBinder, BetaConstraints resultBinder, Behavior[] behaviors, Accumulate accumulate, boolean unwrapRightObject, BuildContext context)
           
 
Method Summary
 void assertLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
          Assert a new ReteTuple.
 void assertObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
           
 LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, LeftTupleSink sink, 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)
          Creates a BetaMemory for the BetaNode's memory.
protected  void doRemove(InternalWorkingMemory workingMemory, AccumulateNode.AccumulateMemory memory)
           
 boolean equals(Object object)
           
 void evaluateResultConstraints(AccumulateNode.ActivitySource source, LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory, AccumulateNode.AccumulateMemory memory, AccumulateNode.AccumulateContext accctx, boolean useLeftMemory)
          Evaluate result constraints and propagate assert in case they are true
 short getType()
           
 int hashCode()
          The hashCode return is simply the unique id of the node.
 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 context, InternalWorkingMemory workingMemory)
           
protected  LeftTuple[] splitList(LeftTuple parent, AccumulateNode.AccumulateContext accctx, boolean isUpdatingSink)
           
 void updateSink(LeftTupleSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.drools.reteoo.BetaNode
attach, attach, createMemory, createRightTuple, doRemove, dumpMemory, getBehaviors, getConstraints, getFirstLeftTuple, getFirstLeftTuple, getFirstRightTuple, getFirstRightTuple, getLeftIterator, getLeftTupleSource, getNextLeftTupleSinkNode, getNextObjectSinkNode, getObjectTypeNode, getPreviousLeftTupleSinkNode, getPreviousObjectSinkNode, getRawConstraints, getRightIterator, getRules, isConcurrentRightTupleMemory, isLeftTupleMemoryEnabled, isObjectMemoryEnabled, leftUnlinked, modifyLeftTuple, modifyObject, networkUpdated, rightUnlinked, setConcurrentRightTupleMemory, setLeftTupleMemoryEnabled, setNextLeftTupleSinkNode, setNextObjectSinkNode, setObjectMemoryEnabled, setPreviousLeftTupleSinkNode, setPreviousObjectSinkNode, setUnificationJoin, toString
 
Methods inherited from class org.drools.reteoo.LeftTupleSource
addTupleSink, getSinkPropagator, isInUse, removeTupleSink
 
Methods inherited from class org.drools.common.BaseNode
addAssociation, getAssociations, getId, getPartitionId, remove, removeAssociation, setPartitionId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.common.NetworkNode
getId, getPartitionId
 
Methods inherited from interface org.drools.common.NodeMemory
getId
 

Constructor Detail

AccumulateNode

public AccumulateNode()

AccumulateNode

public AccumulateNode(int id,
                      LeftTupleSource leftInput,
                      ObjectSource rightInput,
                      AlphaNodeFieldConstraint[] resultConstraints,
                      BetaConstraints sourceBinder,
                      BetaConstraints resultBinder,
                      Behavior[] behaviors,
                      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

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)

assertObject

public void assertObject(InternalFactHandle factHandle,
                         PropagationContext context,
                         InternalWorkingMemory workingMemory)

retractRightTuple

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

modifyLeftTuple

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

modifyRightTuple

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

evaluateResultConstraints

public void evaluateResultConstraints(AccumulateNode.ActivitySource source,
                                      LeftTuple leftTuple,
                                      PropagationContext context,
                                      InternalWorkingMemory workingMemory,
                                      AccumulateNode.AccumulateMemory memory,
                                      AccumulateNode.AccumulateContext accctx,
                                      boolean useLeftMemory)
Evaluate result constraints and propagate assert in case they are true

Parameters:
leftTuple -
context -
workingMemory -
memory -
accresult -
handle -

updateSink

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

doRemove

protected void doRemove(InternalWorkingMemory workingMemory,
                        AccumulateNode.AccumulateMemory memory)

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)
Creates a BetaMemory for the BetaNode's memory.


getType

public short getType()

splitList

protected LeftTuple[] splitList(LeftTuple parent,
                                AccumulateNode.AccumulateContext accctx,
                                boolean isUpdatingSink)

createLeftTuple

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

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 LeftTupleSink sink,
                                 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)


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