|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jess.Token
A Token is the fundamental unit of communication in the Rete network. Each Token represents one or more facts and an indication of whether those facts are being asserted or being retracted.
The Token class is used to represent partial matches in
the Rete network. You'll use it if
you're writing an Accelerator
(not documented here), if
you're working with old-style queries, or possibly if you're writing a
Strategy
implementation.
Accelerator
,
Strategy
,
Serialized FormConstructor Summary | |
Token(Fact firstFact)
Construct a token containing a single Fact. |
|
Token(Fact firstFact,
int unused)
Deprecated. See #Token(Fact) |
|
Token(Token t)
Create a new Token identical to an old one |
|
Token(Token t,
Fact newFact)
Create a new Token containing the same data as an old one |
|
Token(Token lt,
Token rt)
Create a new Token containing the same data as an old one |
Method Summary | |
boolean |
dataEquals(Token t)
Compare the data in this token to another token. |
boolean |
equals(java.lang.Object o)
Compare this token to another object. |
Fact |
fact(int i)
Return a fact from this token. |
boolean |
fastDataEquals(Token t)
|
int |
hashCode()
Use the sortcode, based on the contained facts, as the hashcode. |
Token |
prepare(boolean b)
A chance for a token to duplicate itself Used by extensions |
int |
size()
Returns the number of facts in this token |
Fact |
topFact()
Return the last fact in the Token (the "most recent" one). |
java.lang.String |
toString()
Return a string (useful for debugging) describing this token. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Token(Fact firstFact, int unused) throws JessException
public Token(Fact firstFact) throws JessException
public Token(Token t, Fact newFact) throws JessException
public Token(Token lt, Token rt) throws JessException
public Token(Token t) throws JessException
Method Detail |
public final Fact topFact()
public final Fact fact(int i)
i
- the index (0-based) of the fact to retrieve. More recent
(later) facts have larger indexes.
public final int size()
public final boolean dataEquals(Token t)
t
- Another token to compare to
public final boolean fastDataEquals(Token t)
public boolean equals(java.lang.Object o)
o
- Another object to compare to
public java.lang.String toString()
public int hashCode()
public Token prepare(boolean b) throws JessException
JessException
|
© 2006 Sandia Corporation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |