|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjess.Context
An execution context. A Context represents a scope in which variables can be declared. It also holds a pointer to a Rete object in which code can be executed.
(C) 2003 E.J. Friedman-Hill and the Sandia Corporation
$Id: Context.java,v 1.4.2.1 2003/05/07 18:08:15 ejfried Exp $
Constructor Summary | |
Context(Context c)
Create a new context subordinate to an existing one. |
|
Context(Context c,
Rete engine)
Create a new context subordinate to an existing one. |
Method Summary | |
void |
clearReturnValue()
Clear the return flag and return value for this context. |
Rete |
getEngine()
Returns the Rete engine associated with this context. |
Fact |
getFact()
If this context represents a join network node from a rule LHS, this will return the right input of the node. |
jess.LogicalNode |
getLogicalSupportNode()
If this context represents the RHS of a rule which is firing, and the LHS of the rule has provided logical support, this method will return the LogicalNode that lends support. |
Value |
getReturnValue()
Get the value set via setReturnValue |
Token |
getToken()
If this context represents a join network node from a rule LHS, this will return the left input of the node. |
Value |
getVariable(java.lang.String name)
Get the value of a variable |
Context |
pop()
Pop this context off the execution stack. |
Context |
push()
Create and return a new context subordinate to this one. |
boolean |
returning()
Returns true if the return flag has been set in this context. |
Value |
setReturnValue(Value val)
Set the return flag to true, and supply a value to be returned. |
void |
setVariable(java.lang.String name,
Value value)
Set a (possibly new) variable to some type and value |
java.lang.String |
toString()
Returns a useful debug representation of the context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Context(Context c)
c
- The parent for the new contextpush()
public Context(Context c, Rete engine)
c
- The parent for the new contextengine
- The value to be returned from getEngineMethod Detail |
public final Token getToken()
public final Fact getFact()
public final jess.LogicalNode getLogicalSupportNode()
public final boolean returning()
public final Value setReturnValue(Value val)
val
- The value that should be returned from this context
public final Value getReturnValue()
public final void clearReturnValue()
public final Rete getEngine()
public Context push()
public Context pop()
public Value getVariable(java.lang.String name) throws JessException
name
- The name of the variable with no leading '?' or '$'
characters
JessException
- If the variable is undefinedpublic void setVariable(java.lang.String name, Value value) throws JessException
name
- Name of the variablevalue
- The value of the variable
JessException
public java.lang.String toString()
|
© 2001 E.J. Friedman-Hill and Sandia Corporation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |