java.lang
Class Boolean

java.lang.Object
  |
  +--java.lang.Boolean

public class Boolean
extends Object

The Boolean class represents values of type boolean.


Field Summary
static Boolean FALSE
          A Boolean object corresponding to the value false.
static Boolean TRUE
          A Boolean object corresponding to the value true.
 
Constructor Summary
Boolean(boolean value)
          Create a new Boolean object with the given value.
Boolean(String s)
          Create a Boolean object from a string.
 
Method Summary
 boolean booleanValue()
          Return the value of this object.
 boolean equals(Object obj)
          Return true if obj refers to the same value as this object.
 int hashcode()
          Return the hashcode for the Boolean object.
 String toString()
          Convert the Boolean to a string.
static boolean valueOf(String s)
          Convert a string to a boolean value.
 

Field Detail

TRUE

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

FALSE

public static final Boolean FALSE
A Boolean object corresponding to the value false.
Constructor Detail

Boolean

public Boolean(boolean value)
Create a new Boolean object with the given value.
Parameters:
value - the boolean value the object should be given.

Boolean

public Boolean(String s)
Create a Boolean object from a string. The value of the object is true if, and only if, s is the string "true", ignoring case.
Parameters:
s - the string to base the object value on.
Method Detail

toString

public String toString()
Convert the Boolean to a string. The value of the returned string is either "true" or "false".
Returns:
the value of this object as a string.

equals

public boolean equals(Object obj)
Return true if obj refers to the same value as this object.
Overrides:
equals in class Object
Parameters:
obj - the object to compare to.
Returns:
whether this object and obj refer to the same value.

hashcode

public int hashcode()
Return the hashcode for the Boolean object. If the value of this object is true then 1231 is returned. If the value is false then 1237 is returned.
Returns:
hash code of the object.

booleanValue

public boolean booleanValue()
Return the value of this object.
Returns:
the value of this Boolean object.

valueOf

public static boolean valueOf(String s)
Convert a string to a boolean value. The value of a string is true if and only if the string is not null, and is equal to "true", ignoring case.
Parameters:
s - String object to covert to a boolean.
Returns:
the value of the String as a boolean.