Package org.drools.core.spi
Interface Tuple
-
- All Superinterfaces:
Entry<Tuple>,Serializable
- All Known Subinterfaces:
LeftTuple,RightTuple
- All Known Implementing Classes:
BaseLeftTuple,BaseTuple,EvalNodeLeftTuple,FromNodeLeftTuple,JoinNodeLeftTuple,LeftTupleImpl,NotNodeLeftTuple,QueryElementNodeLeftTuple,QueryRiaFixerNodeLeftTuple,ReactiveFromNodeLeftTuple,RightTupleImpl,RuleTerminalNodeLeftTuple,SubnetworkTuple,WindowTuple
public interface Tuple extends Serializable, Entry<Tuple>
Partial matches are propagated through the Rete network asTuples. EachTupleIs able to return theFactHandleImplmembers of the partial match for the requested pattern. The pattern refers to the index position of theFactHandleImplin the underlying implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static shortDELETEstatic shortINSERTstatic shortNONEstatic shortNORMALIZED_DELETEstatic shortUPDATE
-
Method Summary
-
-
-
Field Detail
-
NONE
static final short NONE
- See Also:
- Constant Field Values
-
INSERT
static final short INSERT
- See Also:
- Constant Field Values
-
UPDATE
static final short UPDATE
- See Also:
- Constant Field Values
-
DELETE
static final short DELETE
- See Also:
- Constant Field Values
-
NORMALIZED_DELETE
static final short NORMALIZED_DELETE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getObject
Object getObject(int pattern)
-
getObject
Object getObject(Declaration declaration)
-
toObjects
default Object[] toObjects()
-
toObjects
Object[] toObjects(boolean reverse)
-
get
InternalFactHandle get(int pattern)
Returns theFactHandlefor the given pattern index. If the pattern is empty It returns null.- Parameters:
pattern- The index of the pattern from which theFactHandleImplis to be returned- Returns:
- The
FactHandle
-
getTuple
Tuple getTuple(int index)
Returns the tuple at the given index- Parameters:
index-- Returns:
-
get
InternalFactHandle get(Declaration declaration)
Returns theFactHandlefor the givenDeclaration, which in turn specifcy thePatternthat they depend on.- Parameters:
declaration- TheDeclarationwhich specifies thePattern- Returns:
- The
FactHandle
-
toFactHandles
InternalFactHandle[] toFactHandles()
Returns the fact handles in reverse order
-
size
int size()
Returns the size of this tuple in number of elements (patterns)
-
getIndex
int getIndex()
-
getParent
Tuple getParent()
-
getFactHandle
InternalFactHandle getFactHandle()
-
setFactHandle
void setFactHandle(InternalFactHandle handle)
-
getOriginalFactHandle
InternalFactHandle getOriginalFactHandle()
-
getSubTuple
Tuple getSubTuple(int elements)
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;- 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;
-
getContextObject
Object getContextObject()
-
setContextObject
void setContextObject(Object object)
-
getStagedType
short getStagedType()
-
setStagedType
void setStagedType(short stagedType)
-
isDeleted
default boolean isDeleted()
-
getStagedPrevious
Tuple getStagedPrevious()
-
setStagedPrevious
void setStagedPrevious(Tuple stagePrevious)
-
getStagedNext
<T extends Tuple> T getStagedNext()
-
setStagedNext
void setStagedNext(Tuple stageNext)
-
clear
void clear()
-
clearStaged
void clearStaged()
-
reAdd
void reAdd()
-
unlinkFromRightParent
void unlinkFromRightParent()
-
unlinkFromLeftParent
void unlinkFromLeftParent()
-
getPropagationContext
PropagationContext getPropagationContext()
-
setPropagationContext
void setPropagationContext(PropagationContext propagationContext)
-
getPrevious
Tuple getPrevious()
-
setPrevious
void setPrevious(Tuple previous)
-
getTupleSink
<S extends Sink> S getTupleSink()
-
getMemory
TupleList getMemory()
-
setMemory
void setMemory(TupleList memory)
-
increaseActivationCountForEvents
void increaseActivationCountForEvents()
-
decreaseActivationCountForEvents
void decreaseActivationCountForEvents()
-
getRootTuple
Tuple getRootTuple()
-
skipEmptyHandles
Tuple skipEmptyHandles()
-
getFirstChild
LeftTuple getFirstChild()
-
setFirstChild
void setFirstChild(LeftTuple firstChild)
-
getLastChild
LeftTuple getLastChild()
-
setLastChild
void setLastChild(LeftTuple firstChild)
-
getHandlePrevious
<T extends Tuple> T getHandlePrevious()
-
setHandlePrevious
void setHandlePrevious(Tuple leftParentLeft)
-
getHandleNext
<T extends Tuple> T getHandleNext()
-
setHandleNext
void setHandleNext(Tuple leftParentright)
-
getInputOtnId
ObjectTypeNode.Id getInputOtnId()
-
getTupleSource
<N extends NetworkNode> N getTupleSource()
-
isExpired
boolean isExpired()
-
findMostRecentPropagationContext
default PropagationContext findMostRecentPropagationContext()
-
-