org.zilonis.network
Class Token

java.lang.Object
  extended by org.zilonis.util.MultiListElement
      extended by org.zilonis.network.Token
All Implemented Interfaces:
Deletable, IMultiListElement, NextHolder

public class Token
extends MultiListElement
implements Deletable


Field Summary
static int HASH_BUCKET
           
static int MEMORY
           
static int NCC_RESULTS
           
static int NEW_RESULTS_BUFFER
           
static int NUMBER_OF_LISTS
          The token belongs to 5 lists: 1) Memory node's items list (The list of tokens in the betaMemory) 1.1) Memory node's hashed items list (indexed nodes) 2) WME's token list 3) It's parent token's children list.
static int PARENT
           
static int WME
           
 
Constructor Summary
Token()
           
Token(Scope scope, Token parent, WME wme)
           
 
Method Summary
 void addChild(Deletable token)
           
 void addNccResult(Token token)
           
 void addNegativeResult(NegativeJoinResult negativeResult)
           
 Token createClone()
           
 void deleteDescendents()
           
 void deleteItAndDescendents()
          public final static int NEW_RESULTS_BUFFER = 5;
 boolean emptyNccResults()
           
 boolean emptyNegativeResults()
           
 java.util.Iterator<Token> getNCCJoinResults()
           
 java.util.Iterator<NegativeJoinResult> getNegativeJoinResultIterator()
           
 Token getOwner()
           
 Token getParent()
           
 Token getParent(int length)
           
 Scope getScope()
           
 TokensHolder getTokensHolder()
           
 WME getWME()
           
 void setOwner(Token owner)
           
 void setTokensHolder(TokensHolder tokensHolder)
           
 java.lang.String toString()
           
 
Methods inherited from class org.zilonis.util.MultiListElement
getNext, getPrev, lock, remove, removeLast, setNext, setPrev, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zilonis.util.IMultiListElement
getNext, getPrev, lock, remove, setNext, setPrev, unlock
 

Field Detail

NUMBER_OF_LISTS

public static final int NUMBER_OF_LISTS
The token belongs to 5 lists: 1) Memory node's items list (The list of tokens in the betaMemory) 1.1) Memory node's hashed items list (indexed nodes) 2) WME's token list 3) It's parent token's children list. The list of children tokens (the ones that have this as their parent) 4) NCC results 5) NCC Partner Node results buffer The token is always in only one Scope, so no need to do anything fancy because of the constraint of having only WMEs in the leaf nodes).

See Also:
Constant Field Values

MEMORY

public static final int MEMORY
See Also:
Constant Field Values

HASH_BUCKET

public static final int HASH_BUCKET
See Also:
Constant Field Values

WME

public static final int WME
See Also:
Constant Field Values

PARENT

public static final int PARENT
See Also:
Constant Field Values

NCC_RESULTS

public static final int NCC_RESULTS
See Also:
Constant Field Values

NEW_RESULTS_BUFFER

public static final int NEW_RESULTS_BUFFER
See Also:
Constant Field Values
Constructor Detail

Token

public Token()

Token

public Token(Scope scope,
             Token parent,
             WME wme)
Method Detail

getScope

public Scope getScope()

setTokensHolder

public void setTokensHolder(TokensHolder tokensHolder)

getTokensHolder

public TokensHolder getTokensHolder()

createClone

public Token createClone()

deleteItAndDescendents

public void deleteItAndDescendents()
public final static int NEW_RESULTS_BUFFER = 5;

Specified by:
deleteItAndDescendents in interface Deletable

deleteDescendents

public void deleteDescendents()

addChild

public void addChild(Deletable token)

addNegativeResult

public void addNegativeResult(NegativeJoinResult negativeResult)

emptyNegativeResults

public boolean emptyNegativeResults()

addNccResult

public void addNccResult(Token token)

emptyNccResults

public boolean emptyNccResults()

getWME

public WME getWME()

getParent

public Token getParent()

getParent

public Token getParent(int length)

getNegativeJoinResultIterator

public java.util.Iterator<NegativeJoinResult> getNegativeJoinResultIterator()

getNCCJoinResults

public java.util.Iterator<Token> getNCCJoinResults()

toString

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

setOwner

public void setOwner(Token owner)

getOwner

public Token getOwner()