org.drools.reteoo
Class ParameterNode

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

class ParameterNode
extends TupleSource

Receives Objects from an ObjectTypeNode, and creates a ReteTuple, passing the result to the following node.

The ParameterNode is the first node that works in terms of Tuples. An instance of ParameterNode exists for each root fact object parameter of each rule.

Author:
bob mcwhirter
See Also:
ObjectTypeNode, TupleSink

Constructor Summary
ParameterNode(ObjectTypeNode inputNode, Declaration declaration)
          Construct.
 
Method Summary
(package private)  void assertObject(FactHandle handle, Object object, WorkingMemoryImpl workingMemory)
          Assert a new fact object into this RuleBase and the specified WorkingMemory.
 Declaration getDeclaration()
          Retrieve the root fact object Declaration.
 Set getTupleDeclarations()
          Retrieve the Set of Declaration s in the propagated Tuples.
 TupleSink getTupleSink()
          Retrieve the TupleSink that receives propagated Tuples.
(package private)  void modifyObject(FactHandle handle, Object newObject, WorkingMemoryImpl workingMemory)
          Modify a fact object in this RuleBase and the specified WorkingMemory.
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.
(package private)  void retractObject(FactHandle handle, WorkingMemoryImpl workingMemory)
          Retract a fact object from this RuleBase and the specified WorkingMemory.
protected  void setTupleSink(TupleSink tupleSink)
          Set the TupleSink that receives Tuples propagated from this TupleSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterNode

public ParameterNode(ObjectTypeNode inputNode,
                     Declaration declaration)
Construct.

Parameters:
inputNode - The ObjectTypeNode input to this.
declaration - The root fact object Declaration.
Method Detail

assertObject

void assertObject(FactHandle handle,
                  Object object,
                  WorkingMemoryImpl workingMemory)
            throws AssertionException
Assert a new fact object into this RuleBase and the specified WorkingMemory.

Parameters:
handle - The fact handle.
object - The object to assert.
workingMemory - The working memory session.
Throws:
AssertionException - if an error occurs during assertion.

retractObject

void retractObject(FactHandle handle,
                   WorkingMemoryImpl workingMemory)
             throws RetractionException
Retract a fact object from this RuleBase and the specified WorkingMemory.

Parameters:
handle - The handle to the fact to retract.
workingMemory - The working memory session.
Throws:
RetractionException - if an error occurs during retraction.

modifyObject

void modifyObject(FactHandle handle,
                  Object newObject,
                  WorkingMemoryImpl workingMemory)
            throws FactException
Modify a fact object in this RuleBase and the specified WorkingMemory. With the exception of time-based nodes, modification of a fact object is semantically equivelent to retracting and re-asserting it.

Parameters:
handle - The fact handle.
newObject - The new fact value object.
workingMemory - The working memory session.
Throws:
FactException - if an error occurs during modification.

getDeclaration

public Declaration getDeclaration()
Retrieve the root fact object Declaration.

Returns:
The Declaration.

getTupleDeclarations

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

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

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.