org.drools.reteoo
Class FromNode

java.lang.Object
  extended by org.drools.common.BaseNode
      extended by org.drools.reteoo.LeftTupleSource
          extended by org.drools.reteoo.FromNode
All Implemented Interfaces:
Externalizable, Serializable, NetworkNode, NodeMemory, LeftTupleSink, LeftTupleSinkNode, Sink

public class FromNode
extends LeftTupleSource
implements LeftTupleSinkNode, NodeMemory

See Also:
Serialized Form

Nested Class Summary
static class FromNode.FromMemory
           
 
Field Summary
protected  AlphaNodeFieldConstraint[] alphaConstraints
           
protected  BetaConstraints betaConstraints
           
protected  DataProvider dataProvider
           
protected  From from
           
protected  LeftTupleSinkNode nextTupleSinkNode
           
protected  LeftTupleSinkNode previousTupleSinkNode
           
protected  Class<?> resultClass
           
protected  boolean tupleMemoryEnabled
           
protected  LeftTupleSource tupleSource
           
 
Fields inherited from class org.drools.reteoo.LeftTupleSource
sink
 
Fields inherited from class org.drools.common.BaseNode
associations, id, partitionId, partitionsEnabled
 
Constructor Summary
FromNode()
           
FromNode(int id, DataProvider dataProvider, LeftTupleSource tupleSource, AlphaNodeFieldConstraint[] constraints, BetaConstraints binder, boolean tupleMemoryEnabled, BuildContext context, From from)
           
 
Method Summary
 void assertLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
          Assert a new ReteTuple.
 void attach(BuildContext context)
          Attaches the node into the network.
protected  void checkConstraintsAndPropagate(LeftTuple leftTuple, RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory, FromNode.FromMemory memory, boolean useLeftMemory)
           
 LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTupleSink sink)
           
 Memory createMemory(RuleBaseConfiguration config)
           
protected  RightTuple createRightTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory, Object object)
           
protected  void doRemove(RuleRemovalContext context, ReteooBuilder builder, BaseNode node, InternalWorkingMemory[] workingMemories)
          Removes the node from teh network.
 LeftTupleSource getLeftTupleSource()
           
 LeftTupleSinkNode getNextLeftTupleSinkNode()
          Returns the next node
protected  ObjectTypeNode getObjectTypeNode()
           
 LeftTupleSinkNode getPreviousLeftTupleSinkNode()
          Returns the previous node
 short getType()
           
 boolean isLeftTupleMemoryEnabled()
           
 void modifyLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void networkUpdated(UpdateContext updateContext)
          A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an oportunity for state update
protected  RightTuple newRightTuple(InternalFactHandle handle, Object o)
           
 void readExternal(ObjectInput in)
           
 void retractLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
protected  void retractMatch(LeftTuple leftTuple, RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
           
 void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
          Sets the next node
 void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
          Sets the previous node
 void updateSink(LeftTupleSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.drools.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, doModifyLeftTuple, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftNegativeMask, getObjectType, getSinkPropagator, initDeclaredMask, initInferredMask, initMasks, isInUse, modifyLeftTuple, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftListenedProperties, unwrapLeftInput
 
Methods inherited from class org.drools.common.BaseNode
addAssociation, attach, getAssociations, getId, getPartitionId, hashCode, remove, removeAssociation, setPartitionId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.reteoo.LeftTupleSink
getLeftInputOtnId, modifyLeftTuple, setLeftInputOtnId
 
Methods inherited from interface org.drools.common.NetworkNode
getId, getPartitionId
 
Methods inherited from interface org.drools.common.NodeMemory
getId
 

Field Detail

dataProvider

protected DataProvider dataProvider

tupleSource

protected LeftTupleSource tupleSource

alphaConstraints

protected AlphaNodeFieldConstraint[] alphaConstraints

betaConstraints

protected BetaConstraints betaConstraints

previousTupleSinkNode

protected LeftTupleSinkNode previousTupleSinkNode

nextTupleSinkNode

protected LeftTupleSinkNode nextTupleSinkNode

from

protected From from

resultClass

protected Class<?> resultClass

tupleMemoryEnabled

protected boolean tupleMemoryEnabled
Constructor Detail

FromNode

public FromNode()

FromNode

public FromNode(int id,
                DataProvider dataProvider,
                LeftTupleSource tupleSource,
                AlphaNodeFieldConstraint[] constraints,
                BetaConstraints binder,
                boolean tupleMemoryEnabled,
                BuildContext context,
                From from)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class LeftTupleSource
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class LeftTupleSource
Throws:
IOException

assertLeftTuple

public void assertLeftTuple(LeftTuple leftTuple,
                            PropagationContext context,
                            InternalWorkingMemory workingMemory)
Description copied from interface: LeftTupleSink
Assert a new ReteTuple.

Specified by:
assertLeftTuple in interface LeftTupleSink
Parameters:
leftTuple - The ReteTuple to propagate.
context - The PropagationContext of the WorkingMemory action
workingMemory - the WorkingMemory session.

createRightTuple

protected RightTuple createRightTuple(LeftTuple leftTuple,
                                      PropagationContext context,
                                      InternalWorkingMemory workingMemory,
                                      Object object)

newRightTuple

protected RightTuple newRightTuple(InternalFactHandle handle,
                                   Object o)

modifyLeftTuple

public void modifyLeftTuple(LeftTuple leftTuple,
                            PropagationContext context,
                            InternalWorkingMemory workingMemory)
Specified by:
modifyLeftTuple in interface LeftTupleSink

checkConstraintsAndPropagate

protected void checkConstraintsAndPropagate(LeftTuple leftTuple,
                                            RightTuple rightTuple,
                                            PropagationContext context,
                                            InternalWorkingMemory workingMemory,
                                            FromNode.FromMemory memory,
                                            boolean useLeftMemory)

retractMatch

protected void retractMatch(LeftTuple leftTuple,
                            RightTuple rightTuple,
                            PropagationContext context,
                            InternalWorkingMemory workingMemory)

retractLeftTuple

public void retractLeftTuple(LeftTuple leftTuple,
                             PropagationContext context,
                             InternalWorkingMemory workingMemory)
Specified by:
retractLeftTuple in interface LeftTupleSink

attach

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

Specified by:
attach in class BaseNode

networkUpdated

public void networkUpdated(UpdateContext updateContext)
Description copied from class: BaseNode
A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an oportunity for state update

Specified by:
networkUpdated in class BaseNode

doRemove

protected void doRemove(RuleRemovalContext context,
                        ReteooBuilder builder,
                        BaseNode node,
                        InternalWorkingMemory[] workingMemories)
Description copied from class: BaseNode
Removes the node from teh network. Usually from the parent ObjectSource or TupleSource

Specified by:
doRemove in class BaseNode

updateSink

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

createMemory

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

isLeftTupleMemoryEnabled

public boolean isLeftTupleMemoryEnabled()
Specified by:
isLeftTupleMemoryEnabled in interface LeftTupleSink

setLeftTupleMemoryEnabled

public void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
Specified by:
setLeftTupleMemoryEnabled in interface LeftTupleSink

getNextLeftTupleSinkNode

public LeftTupleSinkNode getNextLeftTupleSinkNode()
Returns the next node

Specified by:
getNextLeftTupleSinkNode in interface LeftTupleSinkNode
Returns:
The next TupleSinkNode

setNextLeftTupleSinkNode

public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node

Specified by:
setNextLeftTupleSinkNode in interface LeftTupleSinkNode
Parameters:
next - The next TupleSinkNode

getPreviousLeftTupleSinkNode

public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
Returns the previous node

Specified by:
getPreviousLeftTupleSinkNode in interface LeftTupleSinkNode
Returns:
The previous TupleSinkNode

setPreviousLeftTupleSinkNode

public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node

Specified by:
setPreviousLeftTupleSinkNode in interface LeftTupleSinkNode
Parameters:
previous - The previous TupleSinkNode

getType

public short getType()
Specified by:
getType in interface LeftTupleSink

createLeftTuple

public LeftTuple createLeftTuple(InternalFactHandle factHandle,
                                 LeftTupleSink sink,
                                 boolean leftTupleMemoryEnabled)
Specified by:
createLeftTuple in interface LeftTupleSink

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 LeftTupleSink sink,
                                 boolean leftTupleMemoryEnabled)
Specified by:
createLeftTuple in interface LeftTupleSink

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 RightTuple rightTuple,
                                 LeftTupleSink sink)
Specified by:
createLeftTuple in interface LeftTupleSink

createLeftTuple

public LeftTuple createLeftTuple(LeftTuple leftTuple,
                                 RightTuple rightTuple,
                                 LeftTuple currentLeftChild,
                                 LeftTuple currentRightChild,
                                 LeftTupleSink sink,
                                 boolean leftTupleMemoryEnabled)
Specified by:
createLeftTuple in interface LeftTupleSink

getLeftTupleSource

public LeftTupleSource getLeftTupleSource()
Specified by:
getLeftTupleSource in interface LeftTupleSink

getObjectTypeNode

protected ObjectTypeNode getObjectTypeNode()
Specified by:
getObjectTypeNode in class LeftTupleSource


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.