I think Myriam Abramson wrote:
> 
> Why floatValue, stringValue, etc. need a jess context 
> parameter but toString does not? I don't understand how the context
> parameter is used for converting a jess Value to a simple java type.
> 


A Value may represent a variable or a function call instead of a
simple value. If you call floatValue() (for instance) then the Context
is used to get the value of the variable, or the values of any
variables referenced in the function call, which will be evaluated. If
you're absolutely sure that a Value is neither a variable nor a
function call containing variables, then it's safe to pass "null" as
the argument to floatValue() and friends. Of course,
rete.getGlobalContext() is always handy, too.

Value.toString() returns "?X" for a variable X, so it doesn't need the
Context object.

You might want to read chapter 4 of the Jess manual, especially
section 4.2.2. 

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to