Package edu.isi.pegasus.common.util
Class Boolean
- java.lang.Object
-
- edu.isi.pegasus.common.util.Boolean
-
public class Boolean extends java.lang.Object
This class converts a boolean property specification (string) in various representations into a booelan value. It is liberal in the representation it accepts, but strict in what it produces.- Version:
- $Revision$
- Author:
- Gaurang Mehta, Karan Vahi, Jens-S. Vöckler
-
-
Constructor Summary
Constructors Constructor Description Boolean()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
parse(java.lang.String rep)
Converts a boolean string representation into a boolean value.static boolean
parse(java.lang.String rep, boolean deflt)
Converts a boolean string representation into a boolean value.static java.lang.String
print(boolean val)
Converts a boolean value into a strict representation of it.
-
-
-
Field Detail
-
TRUE
public static final java.lang.String TRUE
The character representation of atrue
value.- See Also:
- Constant Field Values
-
FALSE
public static final java.lang.String FALSE
The character representation of afalse
value.- See Also:
- Constant Field Values
-
-
Method Detail
-
print
public static java.lang.String print(boolean val)
Converts a boolean value into a strict representation of it.- Parameters:
val
- is the boolean input value- Returns:
- a string representing the boolean value.
-
parse
public static boolean parse(java.lang.String rep)
Converts a boolean string representation into a boolean value. Representations may include non-negative integers, where only 0 meansfalse
. Other valid string representations oftrue
include:true yes on
Any other string representation is taken to meanfalse
- Parameters:
rep
- is the input string representing a boolean value.- Returns:
- a boolean value from the representation.
-
parse
public static boolean parse(java.lang.String rep, boolean deflt)
Converts a boolean string representation into a boolean value. Representations may include non-negative integers, where only 0 meansfalse
. Other valid string representations oftrue
include:true yes on
Other valid string representations offalse
include, besides the numerical zero:false no off
Any other string representation is taken to mean the boolean value indicated by the paramater deflt.- Parameters:
rep
- is the input string representing a boolean value.deflt
- is the deflt value to use in case rep does not represent a valid boolean value.- Returns:
- a boolean value from the representation.
-
-