2004.04.29


com.jdc.type
Class Boolean

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.type.Boolean

public final class Boolean
extends Object

Boolean represents a boolean value. A boolean value may be either true or false.

In addition, this class provides methods for:

Version:
1.0
Author:
Jay Damon
See Also:
Boolean

Field Summary
static Boolean FALSE
          The Boolean object corresponding to the primitive value false.
static Boolean TRUE
          The Boolean object corresponding to the primitive value true.
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
Boolean(int value)
          Constructs a new Boolean object for the specified int value.
 
Method Summary
static String charValue(boolean value)
          Converts a boolean value to a character String value.
static int intValue(boolean value)
          Converts a boolean value to an int value.
 Boolean toBoolean()
          Returns a Boolean representation of this Boolean object.
 String toString()
          Returns a String representation of this Boolean object.
static boolean toValue(int value)
          Returns true if the int value is 1.
static boolean toValue(String value)
          Returns the boolean status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final Boolean TRUE
The Boolean object corresponding to the primitive value true.


FALSE

public static final Boolean FALSE
The Boolean object corresponding to the primitive value false.

Constructor Detail

Boolean

public Boolean(int value)
Constructs a new Boolean object for the specified int value. An int value of 1 is considered true. All other int values are considered false.

Method Detail

charValue

public static String charValue(boolean value)
Converts a boolean value to a character String value.

Returns:
The boolean value converted to a character (String) value.

intValue

public static int intValue(boolean value)
Converts a boolean value to an int value.

Returns:
The boolean value converted to an int value.

toBoolean

public Boolean toBoolean()
Returns a Boolean representation of this Boolean object.

Returns:
A Boolean representation of this Boolean object.

toString

public String toString()
Returns a String representation of this Boolean object.

Overrides:
toString in class Object
Returns:
A String representation of this Boolean object.

toValue

public static boolean toValue(int value)
Returns true if the int value is 1. This helper method converts an int value to a boolean value. If the int value is 1, a boolean value of true is returned; otherwise, a boolean value of false is returned.

Returns:
True if the int value is 1.
False if the int value is a value other than 1.

toValue

public static boolean toValue(String value)
Returns the boolean status. This is a convenience method to convert a String, e.g. from an XML properties file, to a (primitive) boolean value

Returns:
boolean The boolean status.

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.