Drools :: Core 6.1.0.Beta1

org.drools.core.reteoo
Class BaseLeftTuple

java.lang.Object
  extended by org.drools.core.reteoo.BaseLeftTuple
All Implemented Interfaces:
Serializable, LeftTuple, Tuple, Entry
Direct Known Subclasses:
EvalNodeLeftTuple, FromNodeLeftTuple, JoinNodeLeftTuple, LeftTupleImpl, NotNodeLeftTuple, QueryElementNodeLeftTuple, QueryRiaFixerNodeLeftTuple, RuleTerminalNodeLeftTuple

public class BaseLeftTuple
extends Object
implements Tuple, Entry, LeftTuple

A parent class for all specific LeftTuple specializations

See Also:
Serialized Form

Field Summary
protected  LeftTupleList memory
           
protected  Entry next
           
protected  Entry previous
           
protected  LeftTuple stagedNext
           
protected  LeftTuple stagedPrevious
           
protected  short stagedType
           
 
Fields inherited from interface org.drools.core.reteoo.LeftTuple
DELETE, INSERT, NONE, UPDATE
 
Constructor Summary
BaseLeftTuple()
           
BaseLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, LeftTupleSink sink)
           
BaseLeftTuple(InternalFactHandle factHandle, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
BaseLeftTuple(LeftTuple leftTuple, LeftTupleSink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
           
BaseLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
BaseLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTupleSink sink)
           
BaseLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTupleSink sink, boolean leftTupleMemoryEnabled)
           
 
Method Summary
 void clear()
           
 void clearBlocker()
           
 void clearStaged()
           
 void decreaseActivationCountForEvents()
           
 boolean equals(LeftTuple other)
          We use this equals method to avoid the cast
 boolean equals(Object object)
           
 InternalFactHandle get(Declaration declaration)
          Returns the FactHandle for the given Declaration, which in turn specifcy the Pattern that they depend on.
 InternalFactHandle get(int index)
          Returns the FactHandle for the given pattern index.
 LeftTuple getBlockedNext()
           
 LeftTuple getBlockedPrevious()
           
 RightTuple getBlocker()
           
 LeftTuple getFirstChild()
           
 InternalFactHandle getHandle()
           
 int getIndex()
           
 LeftTuple getLastChild()
           
 InternalFactHandle getLastHandle()
           
 LeftTuple getLeftParent()
           
 LeftTuple getLeftParentNext()
           
 LeftTuple getLeftParentPrevious()
           
 LeftTupleSink getLeftTupleSink()
           
 LeftTupleList getMemory()
           
 Entry getNext()
           
 Object getObject()
           
 LeftTuple getParent()
           
 LeftTuple getPeer()
           
 Entry getPrevious()
           
 PropagationContext getPropagationContext()
           
 RightTuple getRightParent()
           
 LeftTuple getRightParentNext()
           
 LeftTuple getRightParentPrevious()
           
 LeftTuple getRootLeftTuple()
           
 LeftTupleSink getSink()
           
 LeftTuple getStagedNext()
           
 LeftTuple getStagedPrevious()
           
 short getStagedType()
           
 LeftTuple getSubTuple(int elements)
          Returns the ReteTuple that contains the "elements" first elements in this tuple.
 int hashCode()
           
 void increaseActivationCountForEvents()
           
 void initPeer(BaseLeftTuple original, LeftTupleSink sink)
           
 void reAdd()
           
 void reAddLeft()
           
 void reAddRight()
           
 void setBlockedNext(LeftTuple blockerNext)
           
 void setBlockedPrevious(LeftTuple blockerPrevious)
           
 void setBlocker(RightTuple blocker)
           
 void setFactHandle(InternalFactHandle handle)
           
 void setFirstChild(LeftTuple firstChild)
           
 void setHandle(InternalFactHandle handle)
           
 void setIndex(int index)
           
 void setLastChild(LeftTuple lastChild)
           
 void setLeftParent(LeftTuple leftParent)
           
 void setLeftParentNext(LeftTuple leftParentright)
           
 void setLeftParentPrevious(LeftTuple leftParentLeft)
           
 void setLeftTupleSink(LeftTupleSink sink)
           
 void setMemory(LeftTupleList memory)
           
 void setNext(Entry next)
           
 void setObject(Object object)
           
 void setParent(LeftTuple parent)
           
 void setPeer(LeftTuple peer)
           
 void setPrevious(Entry previous)
           
 void setPropagationContext(PropagationContext propagationContext)
           
 void setRightParent(RightTuple rightParent)
           
 void setRightParentNext(LeftTuple rightParentRight)
           
 void setRightParentPrevious(LeftTuple rightParentLeft)
           
 void setSink(LeftTupleSink sink)
           
 void setStagedNext(LeftTuple stageNext)
           
 void setStagedType(short stagedType)
           
 void setStagePrevious(LeftTuple stagePrevious)
           
 int size()
          Returns the size of this tuple in number of elements (patterns)
protected  String toExternalString()
           
 InternalFactHandle[] toFactHandles()
          Returns the fact handles in reverse order
 Object[] toObjectArray()
           
 String toString()
           
 String toTupleTree(int indent)
           
 void unlinkFromLeftParent()
           
 void unlinkFromRightParent()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

memory

protected LeftTupleList memory

next

protected Entry next

previous

protected Entry previous

stagedType

protected volatile short stagedType

stagedNext

protected LeftTuple stagedNext

stagedPrevious

protected LeftTuple stagedPrevious
Constructor Detail

BaseLeftTuple

public BaseLeftTuple()

BaseLeftTuple

public BaseLeftTuple(InternalFactHandle factHandle,
                     LeftTupleSink sink,
                     boolean leftTupleMemoryEnabled)

BaseLeftTuple

public BaseLeftTuple(InternalFactHandle factHandle,
                     LeftTuple leftTuple,
                     LeftTupleSink sink)

BaseLeftTuple

public BaseLeftTuple(LeftTuple leftTuple,
                     LeftTupleSink sink,
                     PropagationContext pctx,
                     boolean leftTupleMemoryEnabled)

BaseLeftTuple

public BaseLeftTuple(LeftTuple leftTuple,
                     RightTuple rightTuple,
                     LeftTupleSink sink)

BaseLeftTuple

public BaseLeftTuple(LeftTuple leftTuple,
                     RightTuple rightTuple,
                     LeftTupleSink sink,
                     boolean leftTupleMemoryEnabled)

BaseLeftTuple

public BaseLeftTuple(LeftTuple leftTuple,
                     RightTuple rightTuple,
                     LeftTuple currentLeftChild,
                     LeftTuple currentRightChild,
                     LeftTupleSink sink,
                     boolean leftTupleMemoryEnabled)
Method Detail

reAdd

public void reAdd()
Specified by:
reAdd in interface LeftTuple

reAddLeft

public void reAddLeft()
Specified by:
reAddLeft in interface LeftTuple

reAddRight

public void reAddRight()
Specified by:
reAddRight in interface LeftTuple

unlinkFromLeftParent

public void unlinkFromLeftParent()
Specified by:
unlinkFromLeftParent in interface LeftTuple

unlinkFromRightParent

public void unlinkFromRightParent()
Specified by:
unlinkFromRightParent in interface LeftTuple

getIndex

public int getIndex()
Specified by:
getIndex in interface LeftTuple

getLeftTupleSink

public LeftTupleSink getLeftTupleSink()
Specified by:
getLeftTupleSink in interface LeftTuple

setLeftTupleSink

public void setLeftTupleSink(LeftTupleSink sink)
Specified by:
setLeftTupleSink in interface LeftTuple

getLeftParent

public LeftTuple getLeftParent()
Specified by:
getLeftParent in interface LeftTuple

setLeftParent

public void setLeftParent(LeftTuple leftParent)
Specified by:
setLeftParent in interface LeftTuple

getLeftParentPrevious

public LeftTuple getLeftParentPrevious()
Specified by:
getLeftParentPrevious in interface LeftTuple

setLeftParentPrevious

public void setLeftParentPrevious(LeftTuple leftParentLeft)
Specified by:
setLeftParentPrevious in interface LeftTuple

getLeftParentNext

public LeftTuple getLeftParentNext()
Specified by:
getLeftParentNext in interface LeftTuple

setLeftParentNext

public void setLeftParentNext(LeftTuple leftParentright)
Specified by:
setLeftParentNext in interface LeftTuple

getRightParent

public RightTuple getRightParent()
Specified by:
getRightParent in interface LeftTuple

setRightParent

public void setRightParent(RightTuple rightParent)
Specified by:
setRightParent in interface LeftTuple

getRightParentPrevious

public LeftTuple getRightParentPrevious()
Specified by:
getRightParentPrevious in interface LeftTuple

setRightParentPrevious

public void setRightParentPrevious(LeftTuple rightParentLeft)
Specified by:
setRightParentPrevious in interface LeftTuple

getRightParentNext

public LeftTuple getRightParentNext()
Specified by:
getRightParentNext in interface LeftTuple

setRightParentNext

public void setRightParentNext(LeftTuple rightParentRight)
Specified by:
setRightParentNext in interface LeftTuple

get

public InternalFactHandle get(int index)
Description copied from interface: Tuple
Returns the FactHandle for the given pattern index. If the pattern is empty It returns null.

Specified by:
get in interface Tuple
Parameters:
index - The index of the pattern from which the FactHandleImpl is to be returned
Returns:
The FactHandle

setFactHandle

public void setFactHandle(InternalFactHandle handle)

getLastHandle

public InternalFactHandle getLastHandle()
Specified by:
getLastHandle in interface LeftTuple

get

public InternalFactHandle get(Declaration declaration)
Description copied from interface: Tuple
Returns the FactHandle for the given Declaration, which in turn specifcy the Pattern that they depend on.

Specified by:
get in interface Tuple
Parameters:
declaration - The Declaration which specifies the Pattern
Returns:
The FactHandle

toFactHandles

public InternalFactHandle[] toFactHandles()
Description copied from interface: Tuple
Returns the fact handles in reverse order

Specified by:
toFactHandles in interface Tuple

clearBlocker

public void clearBlocker()
Specified by:
clearBlocker in interface LeftTuple

setBlocker

public void setBlocker(RightTuple blocker)
Specified by:
setBlocker in interface LeftTuple

getBlocker

public RightTuple getBlocker()
Specified by:
getBlocker in interface LeftTuple

getBlockedPrevious

public LeftTuple getBlockedPrevious()
Specified by:
getBlockedPrevious in interface LeftTuple

setBlockedPrevious

public void setBlockedPrevious(LeftTuple blockerPrevious)
Specified by:
setBlockedPrevious in interface LeftTuple

getBlockedNext

public LeftTuple getBlockedNext()
Specified by:
getBlockedNext in interface LeftTuple

setBlockedNext

public void setBlockedNext(LeftTuple blockerNext)
Specified by:
setBlockedNext in interface LeftTuple

getObject

public final Object getObject()
Specified by:
getObject in interface LeftTuple

setObject

public final void setObject(Object object)
Specified by:
setObject in interface LeftTuple

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(LeftTuple other)
Description copied from interface: LeftTuple
We use this equals method to avoid the cast

Specified by:
equals in interface LeftTuple
Returns:

equals

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

size

public int size()
Description copied from interface: Tuple
Returns the size of this tuple in number of elements (patterns)

Specified by:
size in interface Tuple
Returns:

getHandle

public InternalFactHandle getHandle()
Specified by:
getHandle in interface LeftTuple

setHandle

public void setHandle(InternalFactHandle handle)
Specified by:
setHandle in interface LeftTuple

getFirstChild

public LeftTuple getFirstChild()
Specified by:
getFirstChild in interface LeftTuple

setFirstChild

public void setFirstChild(LeftTuple firstChild)
Specified by:
setFirstChild in interface LeftTuple

getLastChild

public LeftTuple getLastChild()
Specified by:
getLastChild in interface LeftTuple

setLastChild

public void setLastChild(LeftTuple lastChild)
Specified by:
setLastChild in interface LeftTuple

getSink

public LeftTupleSink getSink()
Specified by:
getSink in interface LeftTuple

setSink

public void setSink(LeftTupleSink sink)
Specified by:
setSink in interface LeftTuple

setIndex

public void setIndex(int index)
Specified by:
setIndex in interface LeftTuple

setParent

public void setParent(LeftTuple parent)
Specified by:
setParent in interface LeftTuple

getMemory

public LeftTupleList getMemory()
Specified by:
getMemory in interface LeftTuple

setMemory

public void setMemory(LeftTupleList memory)
Specified by:
setMemory in interface LeftTuple

getPrevious

public Entry getPrevious()
Specified by:
getPrevious in interface LeftTuple

setPrevious

public void setPrevious(Entry previous)
Specified by:
setPrevious in interface LeftTuple

setNext

public void setNext(Entry next)
Specified by:
setNext in interface Entry

getNext

public Entry getNext()
Specified by:
getNext in interface Entry

getStagedType

public short getStagedType()
Specified by:
getStagedType in interface LeftTuple

setStagedType

public void setStagedType(short stagedType)
Specified by:
setStagedType in interface LeftTuple

getStagedNext

public LeftTuple getStagedNext()
Specified by:
getStagedNext in interface LeftTuple

setStagedNext

public void setStagedNext(LeftTuple stageNext)
Specified by:
setStagedNext in interface LeftTuple

getStagedPrevious

public LeftTuple getStagedPrevious()
Specified by:
getStagedPrevious in interface LeftTuple

setStagePrevious

public void setStagePrevious(LeftTuple stagePrevious)
Specified by:
setStagePrevious in interface LeftTuple

clearStaged

public void clearStaged()
Specified by:
clearStaged in interface LeftTuple

getPeer

public LeftTuple getPeer()
Specified by:
getPeer in interface LeftTuple

setPeer

public void setPeer(LeftTuple peer)
Specified by:
setPeer in interface LeftTuple

getSubTuple

public LeftTuple getSubTuple(int elements)
Description copied from interface: LeftTuple
Returns the ReteTuple that contains the "elements" first elements in this tuple.

Use carefully as no cloning is made during this process.

This method is used by TupleStartEqualsConstraint when joining a subnetwork tuple into the main network tuple;

Specified by:
getSubTuple in interface LeftTuple
Parameters:
elements - the number of elements to return, starting from the begining of the tuple
Returns:
a ReteTuple containing the "elements" first elements of this tuple or null if "elements" is greater than size;

toObjectArray

public Object[] toObjectArray()
Specified by:
toObjectArray in interface LeftTuple

getParent

public LeftTuple getParent()
Specified by:
getParent in interface LeftTuple

getRootLeftTuple

public LeftTuple getRootLeftTuple()
Specified by:
getRootLeftTuple in interface LeftTuple

toTupleTree

public String toTupleTree(int indent)
Specified by:
toTupleTree in interface LeftTuple

toExternalString

protected String toExternalString()

increaseActivationCountForEvents

public void increaseActivationCountForEvents()
Specified by:
increaseActivationCountForEvents in interface LeftTuple

decreaseActivationCountForEvents

public void decreaseActivationCountForEvents()
Specified by:
decreaseActivationCountForEvents in interface LeftTuple

getPropagationContext

public PropagationContext getPropagationContext()
Specified by:
getPropagationContext in interface LeftTuple

setPropagationContext

public void setPropagationContext(PropagationContext propagationContext)
Specified by:
setPropagationContext in interface LeftTuple

clear

public void clear()
Specified by:
clear in interface LeftTuple

initPeer

public void initPeer(BaseLeftTuple original,
                     LeftTupleSink sink)

Drools :: Core 6.1.0.Beta1

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