站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 3.0.6 API 英文版文档

RightInputAdapterNode - JBoss RULES 3.0.6 API 英文版文档


org.drools.reteoo
Class RightInputAdapterNode

java.lang.Object
  extended by org.drools.reteoo.RightInputAdapterNode
All Implemented Interfaces:
java.io.Serializable, ReteooNode

public class RightInputAdapterNode
extends java.lang.Object

When joining two Nots together the resulting Tuple from the first Not Must be adapted to FActHandleImpl so it can be propagated into the second not

See Also:
Serialized Form

Field Summary
protected  boolean attachingNewNode
           
protected  boolean hasMemory
           
protected  int id
           
protected  ObjectSinkList objectSinks
          The destination for FactHandleImpl.
protected  int sharedCount
           
 
Constructor Summary
RightInputAdapterNode(int id, int column, org.drools.reteoo.TupleSource source)
          Constructor specifying the unique id of the node in the Rete network, the position of the propagating FactHandleImpl in ReteTuple and the source that propagates the receive ReteTuples.
 
Method Summary
protected  void addObjectSink(ObjectSink objectSink)
          Adds the ObjectSink so that it may receive FactHandleImpl propagated from this ObjectSource.
 void addShare()
          Each time a node is shared a counter is increased.
 void assertTuple(ReteTuple tuple, PropagationContext context, ReteooWorkingMemory workingMemory)
          Takes the asserted ReteTuple received from the TupleSource and extract and propagate its FactHandleImpl based on the column specified by te node.
 void attach()
          Attaches the node into the network.
 void attach(ReteooWorkingMemory[] workingMemories)
           
 int getId()
          Returns the unique id that represents the node in the Rete network
 ObjectSinkList getObjectSinks()
          Retrieve the ObectsSinks that receive propagated FactHandleImpls.
 java.util.List getObjectSinksAsList()
          Returns the object sinks as an unmodifiable list
 int getSharedCount()
          Returns the number of times the node is shared
 int hashCode()
          The hashCode return is simply the unique id of the node.
 boolean hasMemory()
          Indicates whether the node has any memory.
 boolean isInUse()
          Returns true in case the current node is in use (is referenced by any other node)
 boolean isShared()
          Indicates whether the node is shared.
 void modifyTuple(ReteTuple tuple, PropagationContext context, ReteooWorkingMemory workingMemory)
           
protected  void propagateAssertObject(DefaultFactHandle handle, PropagationContext context, ReteooWorkingMemory workingMemory)
          Propagate the assertion of a FactHandleImpl/code> to this node's ObjectSinks.
protected  void propagateModifyObject(DefaultFactHandle handle, PropagationContext context, ReteooWorkingMemory workingMemory)
           
protected  void propagateRetractObject(DefaultFactHandle handle, PropagationContext context, ReteooWorkingMemory workingMemory)
          Propagate the retration of a FactHandleImpl/code> to this node's ObjectSink.
 void remove(org.drools.reteoo.BaseNode node, ReteooWorkingMemory[] workingMemories)
          Removes the node from teh network.
protected  void removeObjectSink(ObjectSink objectSink)
          Removes the ObjectSink
 void removeShare()
          Each time a node is unshared a counter is decreased.
 void retractTuple(ReteTuple tuple, PropagationContext context, ReteooWorkingMemory workingMemory)
           
protected  void setHasMemory(boolean hasMemory)
          Specifies with the node has any memory.
 java.lang.String toString()
           
 void updateNewNode(ReteooWorkingMemory workingMemory, PropagationContext context)
          When nodes are added to the network that already has data. that existing data must be repropagated to the new node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

objectSinks

protected ObjectSinkList objectSinks
The destination for FactHandleImpl.


id

protected final int id

attachingNewNode

protected boolean attachingNewNode

hasMemory

protected boolean hasMemory

sharedCount

protected int sharedCount
Constructor Detail

RightInputAdapterNode

public RightInputAdapterNode(int id,
                             int column,
                             org.drools.reteoo.TupleSource source)
Constructor specifying the unique id of the node in the Rete network, the position of the propagating FactHandleImpl in ReteTuple and the source that propagates the receive ReteTuples.

Parameters:
id - Unique id
column - The column which specifis the position of the FactHandleImpl in the ReteTuple
source - The TupleSource which propagates the received ReteTuple
Method Detail

assertTuple

public void assertTuple(ReteTuple tuple,
                        PropagationContext context,
                        ReteooWorkingMemory workingMemory)
Takes the asserted ReteTuple received from the TupleSource and extract and propagate its FactHandleImpl based on the column specified by te node.

Parameters:
tuple - The asserted ReteTuple.
context - The PropagationContext of the WorkingMemory action.
workingMemory - the WorkingMemory session.

retractTuple

public void retractTuple(ReteTuple tuple,
                         PropagationContext context,
                         ReteooWorkingMemory workingMemory)

modifyTuple

public void modifyTuple(ReteTuple tuple,
                        PropagationContext context,
                        ReteooWorkingMemory workingMemory)

attach

public void attach()
Attaches the node into the network. Usually to the parent ObjectSource or TupleSource


attach

public void attach(ReteooWorkingMemory[] workingMemories)

updateNewNode

public void updateNewNode(ReteooWorkingMemory workingMemory,
                          PropagationContext context)
When nodes are added to the network that already has data. that existing data must be repropagated to the new node. This new propagation may result in one or more assertions, so a PropagationContext and the workingMemory for the facts must be provided.

Parameters:
workingMemory - The WorkingMemory
context - The PropagationContext

remove

public void remove(org.drools.reteoo.BaseNode node,
                   ReteooWorkingMemory[] workingMemories)
Removes the node from teh network. Usually from the parent ObjectSource or TupleSource


addObjectSink

protected void addObjectSink(ObjectSink objectSink)
Adds the ObjectSink so that it may receive FactHandleImpl propagated from this ObjectSource.

Parameters:
objectSink - The ObjectSink to receive propagated FactHandleImpl.

removeObjectSink

protected void removeObjectSink(ObjectSink objectSink)
Removes the ObjectSink

Parameters:
objectSink - The ObjectSink to remove

propagateAssertObject

protected void propagateAssertObject(DefaultFactHandle handle,
                                     PropagationContext context,
                                     ReteooWorkingMemory workingMemory)
Propagate the assertion of a FactHandleImpl/code> to this node's ObjectSinks.

Parameters:
handle - the FactHandleImpl to be asserted
context - The PropagationContext of the WorkingMemory action
workingMemory - the WorkingMemory session.

propagateRetractObject

protected void propagateRetractObject(DefaultFactHandle handle,
                                      PropagationContext context,
                                      ReteooWorkingMemory workingMemory)
Propagate the retration of a FactHandleImpl/code> to this node's ObjectSink.

Parameters:
handle - the FactHandleImpl to be retractred
context - The PropagationContext of the WorkingMemory action
workingMemory - the WorkingMemory session.

propagateModifyObject

protected void propagateModifyObject(DefaultFactHandle handle,
                                     PropagationContext context,
                                     ReteooWorkingMemory workingMemory)

getObjectSinks

public ObjectSinkList getObjectSinks()
Retrieve the ObectsSinks that receive propagated FactHandleImpls.

Returns:
The ObjectsSinks that receive propagated FactHandles.

getObjectSinksAsList

public java.util.List getObjectSinksAsList()
Returns the object sinks as an unmodifiable list

Returns:

getId

public int getId()
Description copied from interface: ReteooNode
Returns the unique id that represents the node in the Rete network

Specified by:
getId in interface ReteooNode
Returns:
unique int value

setHasMemory

protected void setHasMemory(boolean hasMemory)
Specifies with the node has any memory.

Parameters:
hasMemory -

hasMemory

public boolean hasMemory()
Indicates whether the node has any memory.

Returns:

addShare

public void addShare()
Each time a node is shared a counter is increased.


removeShare

public void removeShare()
Each time a node is unshared a counter is decreased.


isShared

public boolean isShared()
Indicates whether the node is shared.

Returns:

isInUse

public boolean isInUse()
Returns true in case the current node is in use (is referenced by any other node)

Returns:

getSharedCount

public int getSharedCount()
Returns the number of times the node is shared

Returns:
int value indicating the share count.

hashCode

public int hashCode()
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 java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object