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

LeftInputAdapterNode (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.reteoo
Class LeftInputAdapterNode

java.lang.Object
  extended by org.drools.common.BaseNode
      extended by org.drools.reteoo.TupleSource
          extended by org.drools.reteoo.LeftInputAdapterNode
All Implemented Interfaces:
Serializable, NetworkNode, NodeMemory, ObjectSink, ObjectSinkNode

public class LeftInputAdapterNode
extends TupleSource
implements ObjectSinkNode, NodeMemory

All asserting Facts must propagated into the right ObjectSink side of a BetaNode, if this is the first Pattern then there are no BetaNodes to propagate to. LeftInputAdapter is used to adapt an ObjectSink propagation into a TupleSource which propagates a ReteTuple suitable fot the right ReteTuple side of a BetaNode.

Author:
Mark Proctor, Bob McWhirter
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.drools.reteoo.TupleSource
sink
 
Fields inherited from class org.drools.common.BaseNode
hasMemory, id, sharedCount
 
Constructor Summary
LeftInputAdapterNode(int id, ObjectSource source)
          Constructus a LeftInputAdapterNode with a unique id that receives FactHandle from a parent ObjectSource and adds it to a given pattern in the resulting Tuples.
 
Method Summary
 void assertObject(InternalFactHandle handle, PropagationContext context, InternalWorkingMemory workingMemory)
          Takes the asserted FactHandleImpl received from the ObjectSource and puts it in a new ReteTuple before propagating to the TupleSinks
 void attach()
          Attaches the node into the network.
 void attach(InternalWorkingMemory[] workingMemories)
           
 Object createMemory(RuleBaseConfiguration config)
           
 boolean equals(Object object)
           
 ObjectSinkNode getNextObjectSinkNode()
          Returns the next node
 ObjectSinkNode getPreviousObjectSinkNode()
          Returns the previous node
 int hashCode()
          The hashCode return is simply the unique id of the node.
 void remove(BaseNode node, InternalWorkingMemory[] workingMemories)
          Removes the node from teh network.
 void retractObject(InternalFactHandle handle, PropagationContext context, InternalWorkingMemory workingMemory)
          Retract an existing FactHandleImpl by placing it in a new ReteTuple before proagating to the TupleSinks
 void setNextObjectSinkNode(ObjectSinkNode next)
          Sets the next node
 void setPreviousObjectSinkNode(ObjectSinkNode previous)
          Sets the previous node
 void updateSink(TupleSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
           
 
Methods inherited from class org.drools.reteoo.TupleSource
addTupleSink, getSinkPropagator, removeTupleSink
 
Methods inherited from class org.drools.common.BaseNode
addShare, getId, getSharedCount, hasMemory, isInUse, isShared, removeShare, setHasMemory, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.common.NodeMemory
getId
 

Constructor Detail

LeftInputAdapterNode

public LeftInputAdapterNode(int id,
                            ObjectSource source)
Constructus a LeftInputAdapterNode with a unique id that receives FactHandle from a parent ObjectSource and adds it to a given pattern in the resulting Tuples.

Parameters:
id - The unique id of this node in the current Rete network
source - The parent node, where Facts are propagated from
binder - An optional binder to filter out propagations. This binder will exist when a predicate is used in the first pattern, for instance
Method Detail

attach

public void attach()
Description copied from class: BaseNode
Attaches the node into the network. Usually to the parent ObjectSource or TupleSource

Specified by:
attach in class BaseNode

attach

public void attach(InternalWorkingMemory[] workingMemories)
Specified by:
attach in class BaseNode

assertObject

public void assertObject(InternalFactHandle handle,
                         PropagationContext context,
                         InternalWorkingMemory workingMemory)
Takes the asserted FactHandleImpl received from the ObjectSource and puts it in a new ReteTuple before propagating to the TupleSinks

Specified by:
assertObject in interface ObjectSink
Parameters:
handle - The asserted FactHandle/code>.
context - The PropagationContext of the WorkingMemory action.
workingMemory - the WorkingMemory session.

retractObject

public void retractObject(InternalFactHandle handle,
                          PropagationContext context,
                          InternalWorkingMemory workingMemory)
Retract an existing FactHandleImpl by placing it in a new ReteTuple before proagating to the TupleSinks

Specified by:
retractObject in interface ObjectSink
Parameters:
handle - The FactHandle/code> to retract.
context - The PropagationContext of the WorkingMemory action.
workingMemory - the WorkingMemory session.

updateSink

public void updateSink(TupleSink sink,
                       PropagationContext context,
                       InternalWorkingMemory workingMemory)
Specified by:
updateSink in class TupleSource

remove

public void remove(BaseNode node,
                   InternalWorkingMemory[] workingMemories)
Description copied from class: BaseNode
Removes the node from teh network. Usually from the parent ObjectSource or TupleSource

Specified by:
remove in class BaseNode

getNextObjectSinkNode

public ObjectSinkNode getNextObjectSinkNode()
Returns the next node

Specified by:
getNextObjectSinkNode in interface ObjectSinkNode
Returns:
The next ObjectSinkNode

setNextObjectSinkNode

public void setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node

Specified by:
setNextObjectSinkNode in interface ObjectSinkNode
Parameters:
next - The next ObjectSinkNode

getPreviousObjectSinkNode

public ObjectSinkNode getPreviousObjectSinkNode()
Returns the previous node

Specified by:
getPreviousObjectSinkNode in interface ObjectSinkNode
Returns:
The previous ObjectSinkNode

setPreviousObjectSinkNode

public void setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node

Specified by:
setPreviousObjectSinkNode in interface ObjectSinkNode
Parameters:
previous - The previous ObjectSinkNode

hashCode

public int hashCode()
Description copied from class: BaseNode
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 BaseNode

equals

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

createMemory

public Object createMemory(RuleBaseConfiguration config)
Specified by:
createMemory in interface NodeMemory


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.