org.drools.reteoo
Class ReteTuple

java.lang.Object
  extended byorg.drools.reteoo.ReteTuple
All Implemented Interfaces:
Serializable, Tuple

class ReteTuple
extends Object
implements Tuple, Serializable

Base Rete-OO Tuple implementation.

Author:
bob mcwhirter
See Also:
Tuple

Constructor Summary
(package private) ReteTuple(ReteTuple left, ReteTuple right)
           
(package private) ReteTuple(WorkingMemoryImpl workingMemory)
           
(package private) ReteTuple(WorkingMemoryImpl workingMemory, Declaration declaration, FactHandle handle)
           
 
Method Summary
(package private)  boolean dependsOn(FactHandle handle)
          Determine if this tuple depends upon a specified object.
 Object get(Declaration declaration)
          Retrieve the value bound to a particular Declaration.
 FactHandle getFactHandleForObject(Object object)
          Retrieve the FactHandle for a given object.
(package private)  TupleKey getKey()
          Retrieve the key for this tuple.
 long getLeastRecentFactTimeStamp()
           
 long getMostRecentFactTimeStamp()
           
 WorkingMemory getWorkingMemory()
          Returns a reference to the WorkingMemory associated with this object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReteTuple

ReteTuple(WorkingMemoryImpl workingMemory)

ReteTuple

ReteTuple(ReteTuple left,
          ReteTuple right)

ReteTuple

ReteTuple(WorkingMemoryImpl workingMemory,
          Declaration declaration,
          FactHandle handle)
Method Detail

toString

public String toString()

getKey

TupleKey getKey()
Retrieve the key for this tuple.

Returns:
The key.

dependsOn

boolean dependsOn(FactHandle handle)
Determine if this tuple depends upon a specified object.

Parameters:
handle - The object handle to test.
Returns:
true if this tuple depends upon the specified object, otherwise false.

get

public Object get(Declaration declaration)
Description copied from interface: Tuple
Retrieve the value bound to a particular Declaration.

Specified by:
get in interface Tuple
Parameters:
declaration - The Declaration key.
Returns:
The currently bound Object value.
See Also:
Tuple

getFactHandleForObject

public FactHandle getFactHandleForObject(Object object)
Description copied from interface: Tuple
Retrieve the FactHandle for a given object.

Within a consequence of a rule, if the desire is to retract or modify a root fact this method provides a way to retrieve the FactHandle. Facts that are not root fact objects have no handle.

Specified by:
getFactHandleForObject in interface Tuple
Parameters:
object - The object.
Returns:
The fact-handle or null if the supplied object is not a root fact object.
See Also:
Tuple

getWorkingMemory

public WorkingMemory getWorkingMemory()
Description copied from interface: Tuple
Returns a reference to the WorkingMemory associated with this object.

Specified by:
getWorkingMemory in interface Tuple
Returns:
WorkingMemory

getMostRecentFactTimeStamp

public long getMostRecentFactTimeStamp()
Specified by:
getMostRecentFactTimeStamp in interface Tuple

getLeastRecentFactTimeStamp

public long getLeastRecentFactTimeStamp()
Specified by:
getLeastRecentFactTimeStamp in interface Tuple


Copyright © 2001-2004 The Codehaus. All Rights Reserved.