Re: JESS: java.lang.Boolean to Jess Boolean

2001-11-27 Thread ejfried


From Java you should use 

new Value(RU.ATOM, TRUE)

for true, and 

new Value(RU.ATOM, FALSE)

for false. As a shortcut, there are constants Funcall.TRUE and
Funcall.FALSE in the jess.Funcall class.

Note also that String constants in Java (and in Jess) use double
quotes, not single quotes.


I think Mahesh Gandhe wrote:
 
 hi ,
 
 I am writing the java code for the method so that 
 
 the method could be invoked in the command line in jess.
 
 The code is as follows
 
 import jess.*;
 import java.lang.*;
 
 public class GreaterThan implements Userfunction
  {
public String getName() { return my-upcase;}
public Value call (ValueVector vv ,Context context) throws JessException
 {

  Boolean ret = new Boolean (true);
  return new Value (ret,'TRUE');
  }

 }
 }
 
 During compilation it giving error stating that 'TRUE' is not a data type.
 
 can some body tell me how to construct the new JessValue object of 
 
 type java.lang.Boolean.
 
  
 
 Regards,
 
 Mahesh G.
 
  
 
  
 
 
 
 -
 Do You Yahoo!?
 Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.



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


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]





RE: JESS: java.lang.Boolean to Jess Boolean

2001-11-27 Thread Alan Moore

Try:

Boolean ret = new Boolean(true);
return new Value( ret, RU.EXTERNAL_ADDRESS );

Jess does not have a boolean in it's type system like it does for int and
long. It does have the generic EXTERNAL_ADDRESS which can be any Object
including Boolean. See the javadoc for the class RU or RU.java or
Value.java.

Note that in some cases jess performs type conversions so be careful where
and how you use the RU.EXTERNAL_ADDRESS Value objects.

Ernest, any chance for RU.BOOLEAN and a BooleanValue class?

Good luck!

alan


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Mahesh Gandhe
Sent: Tuesday, November 27, 2001 12:51 PM
To: [EMAIL PROTECTED]
Subject: JESS: java.lang.Boolean to Jess Boolean


hi ,
I am writing the java code for the method so that
the method could be invoked in the command line in jess.
The code is as follows
import jess.*;
import java.lang.*;
public class GreaterThan implements Userfunction
 {
   public String getName() { return my-upcase;}
   public Value call (ValueVector vv ,Context context) throws JessException
{

 Boolean ret = new Boolean (true);
 return new Value (ret,'TRUE');
 }

}
}
During compilation it giving error stating that 'TRUE' is not a data type.
can some body tell me how to construct the new JessValue object of
type java.lang.Boolean.

Regards,
Mahesh G.






Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.



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]





Re: JESS: java.lang.Boolean to Jess Boolean

2001-11-27 Thread ejfried


See my other message, and manual section 2.6. Jess -does- have a
boolean type.

I think Alan Moore wrote:
 Try:
 
 Boolean ret = new Boolean(true);
 return new Value( ret, RU.EXTERNAL_ADDRESS );
 
 Jess does not have a boolean in it's type system like it does for int and
 long. It does have the generic EXTERNAL_ADDRESS which can be any Object
 including Boolean. See the javadoc for the class RU or RU.java or
 Value.java.
 
 Note that in some cases jess performs type conversions so be careful where
 and how you use the RU.EXTERNAL_ADDRESS Value objects.
 
 Ernest, any chance for RU.BOOLEAN and a BooleanValue class?
 
 Good luck!
 
 alan
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Mahesh Gandhe
 Sent: Tuesday, November 27, 2001 12:51 PM
 To: [EMAIL PROTECTED]
 Subject: JESS: java.lang.Boolean to Jess Boolean
 
 
 hi ,
 I am writing the java code for the method so that
 the method could be invoked in the command line in jess.
 The code is as follows
 import jess.*;
 import java.lang.*;
 public class GreaterThan implements Userfunction
  {
public String getName() { return my-upcase;}
public Value call (ValueVector vv ,Context context) throws JessException
 {
 
  Boolean ret = new Boolean (true);
  return new Value (ret,'TRUE');
  }
 
 }
 }
 During compilation it giving error stating that 'TRUE' is not a data type.
 can some body tell me how to construct the new JessValue object of
 type java.lang.Boolean.
 
 Regards,
 Mahesh G.
 
 
 
 
 
 
 Do You Yahoo!?
 Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
 
 
 
 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]
 
 



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


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]





Re: JESS: java.lang.Boolean to Jess Boolean

2001-11-27 Thread Mahesh Gandhe
 hi ,
thanks a ton.
The code is working fine and my problem is solved.
Regards,
Mahesh G.
 [EMAIL PROTECTED] wrote: 
From Java you should use new Value(RU.ATOM, "TRUE")for true, and new Value(RU.ATOM, "FALSE")for false. As a shortcut, there are constants Funcall.TRUE andFuncall.FALSE in the jess.Funcall class.Note also that String constants in Java (and in Jess) use doublequotes, not single quotes.I think Mahesh Gandhe wrote:  hi ,  I am writing the java code for the method so that   the method could be invoked in the command line in jess.  The code is as follows  import jess.*; import java.lang.*;  public class GreaterThan implements Userfunction { public String getName() { return "my-upcase";} public Value call (ValueVector vv ,Context context) throws JessException {  Boolean ret = new Boolean (true); return new Value (ret,'TRUE'); }  } }  During compilation it giving error stating that 'TRUE' is not a data type.  can some body tell me how to construct the new JessValue object of   type java.lang.Boolean.Regards,  Mahesh G.- Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.-Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154Sandia National Labs FAX: (925) 294-2234Org. 8920, MS 9012 [EMAIL PROTECTED]PO Box 969 http://herzberg.ca.sandia.govLivermore, CA 94550To 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]Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.

Re: JESS: boolean Value

2001-10-19 Thread ejfried

The boolean values in Jess are the atoms TRUE and FALSE. There are
boolean constants you can use in the Funcall class --
jess.Funcall.TRUE and Jess.Funcall.FALSE and public static Value
objects with the appropriate values, or just use new Value(TRUE, RU.ATOM).

I think [EMAIL PROTECTED] wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
 Hi Guys,
 
 I'm trying to write a few userfunctions that return boolean. Class Value does not 
have a constructor that takes boolean, and RU does not have a boolean field. Is there 
anyway around this?
 
 Thanks
 Dheeraj
 
 




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

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




JESS: Boolean

1999-06-28 Thread James C. Owen

Sometimes I think that a short course in Boolean Logic might be applicable
BEFORE one engages in the task of writing a rulebased routine.  Remember,
"Boole was no foole."  :-)

--

ttfn

IHN
Jim

-
James C. Owen
Knowledge-Based Systems Corporation
4817 Buckskin Drive
Fort Worth, Texas  76137

817.314.0584 Office
817.314.0585 FAX
817.247.8976 Cellular

mailto:[EMAIL PROTECTED]
http://www.kbsc.com

"I Love You ... I Love You ... I Love You. -God"
(Seen on a billboard in DFW MetroPlex.)


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