-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Instead of using java.util.Date, you might try java.util.Calendar. 
Calendar allows after(), before() or equals(), all of which return a
boolean.  Calendar also has <returns Date> getTime() and
setTime(Date) if those are already in your code somewhere.   Just a
thought. :-)

SDG
jco

- -----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Judson, Ross
Sent: Thursday, August 14, 2003 12:13 PM
To: [EMAIL PROTECTED]
Subject: JESS: Handling Time


It's a little frustrating working with time in Jess.  You can store a
time as a java.util.Date, but then you can't compare it with <, >,
etc...if you work with it as a long, then you can't call + and other
math functions; they change the number into INTEGER.  If you work
with time as ms/1000, then you lose a lot of accuracy.

Any suggestions on how best to handle time?

I have a few specific ones:

1. Extend <, >, etc. to work with Comparable objects.
2. Instead of printing ExternalAddress and so forth when printing out
fact lists, use an extra slot descriptor to indicate that toString()
should be called on the object in the fact slot, and that used as the
text to represent the object. 3. Extend + and other math functions to
work with LONG values.

RJ

- --------------------------------------------------------------------
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]
- --------------------------------------------------------------------

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBPz0Gd9xsw6qfZxRLEQLZ4wCfTI/sPGW9tcqKE7F7TsWYYF+d3CIAmwcV
3xDdHIvsC4+LSJeZpFlNpHDx
=0ULf
-----END PGP SIGNATURE-----

--------------------------------------------------------------------
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