[3373] in java-interest

home help back first fref pref prev next nref lref last post

scale() & boolean conversion

daemon@ATHENA.MIT.EDU (Anselm Baird_smith)
Thu Nov 9 14:20:25 1995

Date: Thu, 9 Nov 1995 17:42:17 +0100
From: Anselm Baird_smith <Anselm.Baird_Smith@inria.fr>
To: hsee@citi.doc.ca (Henry See)
Cc: java-interest@java.sun.com
In-Reply-To: <9511091558.AA12692@condor.citi.doc.ca>
Reply-To: Anselm Baird-Smith <Anselm.BairdSmith@inria.fr>


Henry See writes:
 > Hello,
 > 
 > A few minor problems...
 > 
 > 1. We are trying to save and retrieve boolean values in a properties file.
 > They are saved as strings. How do we read them back as booleans? (We can't
 > figure out how to use the getBoolean() method in Boolean which says it
 > reads a property name -- is this the same type of "property"?)

I had the same problem. I used the naive following code:

propval = System.getProperty (...) ;
if ( (propval != null) && (propval.equals ("true")) )
    bool_property = true ;
else
    bool_property = false ;

Although, I would very much like a standard way of getting at least
the basic types (Integer, Double, Real, String, Boolean, etc) from
properties.

Anselm.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post