org.drools.reteoo.impl
Class ConditionNodeImpl

java.lang.Object
  |
  +--org.drools.reteoo.impl.TupleSourceImpl
        |
        +--org.drools.reteoo.impl.ConditionNodeImpl
All Implemented Interfaces:
ConditionNode, TupleSink, TupleSinkImpl, TupleSource

public class ConditionNodeImpl
extends TupleSourceImpl
implements ConditionNode, TupleSinkImpl

Node which filters ReteTuples.

Using a semantic Condition, this node may allow or disallow Tuples to proceed further through the Rete-OO network.

Author:
bob mcwhirter
See Also:
ConditionNode, Condition, ReteTuple

Constructor Summary
ConditionNodeImpl(TupleSourceImpl tupleSource, Condition condition)
          Construct.
 
Method Summary
 void assertTuple(ReteTuple tuple, WorkingMemory workingMemory)
          Assert a new Tuple.
 Condition getCondition()
          Retrieve the Condition associated with this node.
 java.util.Set getTupleDeclarations()
          Retrieve the Set of Declarations in the propagated Tuples.
 void modifyTuples(java.lang.Object trigger, org.drools.reteoo.impl.TupleSet newTuples, WorkingMemory workingMemory)
          Modify tuples.
 void retractTuples(org.drools.reteoo.impl.TupleKey key, WorkingMemory workingMemory)
          Retract tuples.
 java.lang.String toString()
          Produce a debug string.
 
Methods inherited from class org.drools.reteoo.impl.TupleSourceImpl
getTupleSink, propagateAssertTuple, propagateModifyTuples, propagateRetractTuples, setTupleSink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.reteoo.TupleSource
getTupleSink
 

Constructor Detail

ConditionNodeImpl

public ConditionNodeImpl(TupleSourceImpl tupleSource,
                         Condition condition)
Construct.
Parameters:
tupleSource - The source of incoming Tuples.
condition - The semantic Condition.
Method Detail

getCondition

public Condition getCondition()
Retrieve the Condition associated with this node.
Specified by:
getCondition in interface ConditionNode
Returns:
The Condition.

getTupleDeclarations

public java.util.Set getTupleDeclarations()
Retrieve the Set of Declarations in the propagated Tuples.
Specified by:
getTupleDeclarations in interface TupleSource
Returns:
The Set of Declarations in progated Tuples.

assertTuple

public void assertTuple(ReteTuple tuple,
                        WorkingMemory workingMemory)
                 throws AssertionException
Assert a new Tuple.
Specified by:
assertTuple in interface TupleSinkImpl
Parameters:
tuple - The Tuple being asserted.
workingMemory - The working memory seesion.
Throws:
AssertionException - If an error occurs while asserting.

retractTuples

public void retractTuples(org.drools.reteoo.impl.TupleKey key,
                          WorkingMemory workingMemory)
                   throws RetractionException
Retract tuples.
Specified by:
retractTuples in interface TupleSinkImpl
Parameters:
key - The tuple key.
workingMemory - The working memory seesion.
Throws:
RetractionException - If an error occurs while retracting.

modifyTuples

public void modifyTuples(java.lang.Object trigger,
                         org.drools.reteoo.impl.TupleSet newTuples,
                         WorkingMemory workingMemory)
                  throws FactException
Modify tuples.
Specified by:
modifyTuples in interface TupleSinkImpl
Parameters:
trigger - The root fact object.
newTuples - Modification replacement tuples.
workingMemory - The working memory session.
Throws:
FactException - If an error occurs while modifying.

toString

public java.lang.String toString()
Produce a debug string.
Overrides:
toString in class java.lang.Object
Returns:
The debug string.


Copyright © 2001-2002 The Werken Company. All Rights Reserved.