org.drools.reteoo
Class JoinNode

java.lang.Object
  extended byorg.drools.reteoo.TupleSource
      extended byorg.drools.reteoo.JoinNode
All Implemented Interfaces:
Serializable

class JoinNode
extends TupleSource

A two-input Rete-OO join node .

Author:
bob mcwhirter
See Also:
TupleSource, TupleSink

Constructor Summary
JoinNode(TupleSource leftInput, TupleSource rightInput)
          Construct.
 
Method Summary
(package private)  void assertLeftTuple(ReteTuple tuple, WorkingMemoryImpl workingMemory)
          Assert a new Tuple from the left input.
(package private)  void assertRightTuple(ReteTuple tuple, WorkingMemoryImpl workingMemory)
          Assert a new Tuple from the right input.
 Set getCommonDeclarations()
          Retrieve the set of common Declarations across the two input TupleSources.
 Set getTupleDeclarations()
          Retrieve the Set of Declarations.
 TupleSink getTupleSink()
          Retrieve the TupleSink that receives propagated Tuples.
(package private)  void modifyLeftTuples(FactHandle trigger, TupleSet newTuples, WorkingMemoryImpl workingMemory)
          Modify tuples from the left input.
(package private)  void modifyRightTuples(FactHandle trigger, TupleSet newTuples, WorkingMemoryImpl workingMemory)
          Modify tuples from the right input.
protected  void propagateAssertTuple(ReteTuple tuple, WorkingMemoryImpl workingMemory)
          Propagate the assertion of a Tuple to this node's TupleSink.
protected  void propagateModifyTuples(FactHandle trigger, TupleSet newTuples, WorkingMemoryImpl workingMemory)
          Propagate the modification of Tuple s to this node's TupleSink.
protected  void propagateRetractTuples(TupleKey key, WorkingMemoryImpl workingMemory)
          Propagate the retration of a Tuple to this node's TupleSink.
 void retractTuples(TupleKey key, WorkingMemoryImpl workingMemory)
          Retract tuples.
protected  void setTupleSink(TupleSink tupleSink)
          Set the TupleSink that receives Tuples propagated from this TupleSource.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JoinNode

public JoinNode(TupleSource leftInput,
                TupleSource rightInput)
Construct.

Parameters:
leftInput - The left input TupleSource.
rightInput - The right input TupleSource.
Method Detail

toString

public String toString()

getCommonDeclarations

public Set getCommonDeclarations()
Retrieve the set of common Declarations across the two input TupleSources.

Returns:
The Set of common Declarations.

assertLeftTuple

void assertLeftTuple(ReteTuple tuple,
                     WorkingMemoryImpl workingMemory)
               throws AssertionException
Assert a new Tuple from the left input.

Parameters:
tuple - The Tuple being asserted.
workingMemory - The working memory seesion.
Throws:
AssertionException - If an error occurs while asserting.

assertRightTuple

void assertRightTuple(ReteTuple tuple,
                      WorkingMemoryImpl workingMemory)
                throws AssertionException
Assert a new Tuple from the right input.

Parameters:
tuple - The Tuple being asserted.
workingMemory - The working memory seesion.
Throws:
AssertionException - If an error occurs while asserting.

retractTuples

public void retractTuples(TupleKey key,
                          WorkingMemoryImpl workingMemory)
                   throws RetractionException
Retract tuples.

Parameters:
key - The tuple key.
workingMemory - The working memory seesion.
Throws:
RetractionException - If an error occurs while retracting.

modifyLeftTuples

void modifyLeftTuples(FactHandle trigger,
                      TupleSet newTuples,
                      WorkingMemoryImpl workingMemory)
                throws FactException
Modify tuples from the left input.

Parameters:
trigger - The root fact object handle.
newTuples - Modification replacement tuples.
workingMemory - The working memory session.
Throws:
FactException - If an error occurs while modifying.

modifyRightTuples

void modifyRightTuples(FactHandle trigger,
                       TupleSet newTuples,
                       WorkingMemoryImpl workingMemory)
                 throws FactException
Modify tuples from the right input.

Parameters:
trigger - The root fact object handle.
newTuples - Modification replacement tuples.
workingMemory - The working memory session.
Throws:
FactException - If an error occurs while modifying.

getTupleDeclarations

public Set getTupleDeclarations()
Retrieve the Set of Declarations. in the propagated Tuples.

Specified by:
getTupleDeclarations in class TupleSource
Returns:
The Set of Declarations in progated Tuples.
See Also:
Declaration

setTupleSink

protected void setTupleSink(TupleSink tupleSink)
Set the TupleSink that receives Tuples propagated from this TupleSource.

Parameters:
tupleSink - The TupleSink to receive propagated Tuples.

propagateAssertTuple

protected void propagateAssertTuple(ReteTuple tuple,
                                    WorkingMemoryImpl workingMemory)
                             throws AssertionException
Propagate the assertion of a Tuple to this node's TupleSink.

Parameters:
tuple - The Tuple to propagate.
workingMemory - the working memory session.
Throws:
AssertionException - If an errors occurs while attempting assertion.

propagateRetractTuples

protected void propagateRetractTuples(TupleKey key,
                                      WorkingMemoryImpl workingMemory)
                               throws RetractionException
Propagate the retration of a Tuple to this node's TupleSink.

Parameters:
key - The tuple key.
workingMemory - The working memory session.
Throws:
RetractionException - If an error occurs while attempting retraction

propagateModifyTuples

protected void propagateModifyTuples(FactHandle trigger,
                                     TupleSet newTuples,
                                     WorkingMemoryImpl workingMemory)
                              throws FactException
Propagate the modification of Tuple s to this node's TupleSink.

Parameters:
trigger - The modification trigger object handle.
newTuples - Modification replacement tuples.
workingMemory - The working memory session.
Throws:
FactException - If an error occurs while attempting modification.

getTupleSink

public TupleSink getTupleSink()
Retrieve the TupleSink that receives propagated Tuples.

Returns:
The TupleSink that receives propagated Tuples.


Copyright © 2001-2004 The Codehaus. All Rights Reserved.