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

Token - JBoss RULES 3.0.6 API 英文版文档


org.drools.leaps
Class Token

java.lang.Object
  extended by org.drools.leaps.Token
All Implemented Interfaces:
java.io.Serializable, Tuple

public class Token
extends java.lang.Object
implements Tuple, java.io.Serializable

this object wears multiple hats - Tuple and being main element that wraps fact handle on main leaps stack

See Also:
Serialized Form

Constructor Summary
Token(org.drools.leaps.LeapsWorkingMemory workingMemory, InternalFactHandle factHandle, PropagationContext propagationContext)
           
 
Method Summary
 boolean dependsOn(FactHandle handle)
          Determine if this tuple depends upon a specified object.
 boolean equals(java.lang.Object that)
          We always have only one Tuple per fact handle hence match on handle id
 InternalFactHandle get(Declaration declaration)
          Returns the FactHandle for the given Declaration, which in turn specifcy the Column that they depend on.
 InternalFactHandle get(int idx)
          Retrieve the value at position
 LeapsRuleHandle getCurrentRuleHandle()
           
 InternalFactHandle getDominantFactHandle()
           
 InternalFactHandle[] getFactHandles()
           
 PropagationContext getPropagationContext()
           
 long getRecency()
           
 WorkingMemory getWorkingMemory()
          Returns a reference to the WorkingMemory associated with this object.
 int hashCode()
           
 boolean hasNextRuleHandle()
           
 boolean isResume()
           
 LeapsRuleHandle nextRuleHandle()
           
 void set(int idx, LeapsFactHandle factHandle)
           
 void setActivation(Activation activation)
          Do nothing because this tuple never gets to agendaItem stage.
 void setResume(boolean resume)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(org.drools.leaps.LeapsWorkingMemory workingMemory,
             InternalFactHandle factHandle,
             PropagationContext propagationContext)
Method Detail

nextRuleHandle

public LeapsRuleHandle nextRuleHandle()

hasNextRuleHandle

public boolean hasNextRuleHandle()
Parameters:
memory -
Returns:
indicator if there are more rules

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

set

public void set(int idx,
                LeapsFactHandle factHandle)

getDominantFactHandle

public InternalFactHandle getDominantFactHandle()

getCurrentRuleHandle

public LeapsRuleHandle getCurrentRuleHandle()

isResume

public boolean isResume()

setResume

public void setResume(boolean resume)

equals

public boolean equals(java.lang.Object that)
We always have only one Tuple per fact handle hence match on handle id

Overrides:
equals in class java.lang.Object
See Also:
Object

get

public InternalFactHandle get(int idx)
Retrieve the value at position

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

get

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

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

getFactHandles

public InternalFactHandle[] getFactHandles()
Specified by:
getFactHandles in interface Tuple
See Also:
Tuple

getRecency

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

getWorkingMemory

public WorkingMemory getWorkingMemory()
Returns a reference to the WorkingMemory associated with this object.

Returns:
WorkingMemory

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object

dependsOn

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

Specified by:
dependsOn in interface Tuple
Parameters:
handle - The object handle to test.
Returns:
true if this tuple depends upon the specified object, otherwise false.

setActivation

public void setActivation(Activation activation)
Do nothing because this tuple never gets to agendaItem stage. Another one - LeapsTuple - is created to take part in agendaItem processing

Specified by:
setActivation in interface Tuple
See Also:
getTuple(), Tuple

getPropagationContext

public PropagationContext getPropagationContext()