org.drools.reteoo
Class ConditionNode

java.lang.Object
  extended by org.drools.reteoo.TupleSource
      extended by org.drools.reteoo.ConditionNode
All Implemented Interfaces:
Serializable, TupleSink

 class ConditionNode
extends TupleSource
implements TupleSink

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
ConditionNode(Rule rule, TupleSource tupleSource, Condition condition)
          Construct.
 
Method Summary
 void assertTuple(ReteTuple tuple, WorkingMemoryImpl workingMemory)
          Assert a new Tuple.
 void attach()
          Attaches this node into the network.
 boolean equals(Object object)
           
 Condition getCondition()
          Retrieve the Condition associated with this node.
 Set getTupleDeclarations()
          Retrieve the Set of Declaration s in the propagated Tuples.
 int hashCode()
           
 void retractTuples(TupleKey key, WorkingMemoryImpl workingMemory)
          Retract tuples.
 String toString()
          Produce a debug string.
 
Methods inherited from class org.drools.reteoo.TupleSource
addTupleSink, getTupleSinks, propagateAssertTuple, propagateRetractTuples
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionNode

ConditionNode(Rule rule,
              TupleSource tupleSource,
              Condition condition)
Construct.

Parameters:
rule - The rule
tupleSource - The source of incoming Tuples.
condition -
Method Detail

attach

public void attach()
Attaches this node into the network.

Specified by:
attach in class TupleSource

getCondition

public Condition getCondition()
Retrieve the Condition associated with this node.

Returns:
The Condition.

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.

assertTuple

public void assertTuple(ReteTuple tuple,
                        WorkingMemoryImpl workingMemory)
                 throws AssertionException
Assert a new Tuple.

Specified by:
assertTuple in interface TupleSink
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.

Specified by:
retractTuples in interface TupleSink
Parameters:
key - The tuple key.
workingMemory - The working memory seesion.
Throws:
RetractionException - If an error occurs while retracting.

toString

public String toString()
Produce a debug string.

Overrides:
toString in class Object
Returns:
The debug string.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


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