Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.lang

Class Boolean

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

All Implemented Interfaces:

Serializable


public final class Boolean

extends Object

implements Serializable

Instances of class Boolean represent primitive boolean values.

Since:Authors:

Field Summary

static java.lang.BooleanFALSE

This field is a Boolean object representing the primitive value false.
static java.lang.BooleanTRUE

This field is a Boolean object representing the primitive value true.
static java.lang.ClassTYPE

The primitive type boolean is represented by this Class object.

Constructor Summary

Boolean(boolean value)

Create a Boolean object representing the value of the argument value.
Boolean(java.lang.String s)

Creates a Boolean object representing the primitive true if and only if s matches the string "true" ignoring case, otherwise the object will represent the primitive false.

Method Summary

booleanbooleanValue()

Return the primitive boolean value of this Boolean object.
booleanequals(java.lang.Object obj)

If the obj is an instance of Boolean and has the same primitive value as this object then true is returned.
static booleangetBoolean(java.lang.String name)

If the value of the system property name matches "true" ignoring case then the function returns true.
inthashCode()

Returns the integer 1231 if this object represents the primitive true and the integer 1237 otherwise.
static java.lang.StringtoString(boolean b)

Returns "true" if the value of the give boolean is true and returns "false" if the value of the given boolean is false.
java.lang.StringtoString()

Returns "true" if the value of this object is true and returns "false" if the value of this object is false.
static java.lang.BooleanvalueOf(boolean b)

Returns the Boolean TRUE if the given boolean is true, otherwise it will return the Boolean FALSE.
static java.lang.BooleanvalueOf(java.lang.String s)

Returns the Boolean TRUE if and only if the given String is equal, ignoring case, to the the String "true", otherwise it will return the Boolean FALSE.

Field Details

FALSE

public static final Boolean FALSE

This field is a Boolean object representing the primitive value false. This instance is returned by the static valueOf() methods if they return a Boolean representing false.


TRUE

public static final Boolean TRUE

This field is a Boolean object representing the primitive value true. This instance is returned by the static valueOf() methods if they return a Boolean representing true.


TYPE

public static final Class TYPE

The primitive type boolean is represented by this Class object.

Since:

Constructor Details

Boolean

public Boolean(boolean value)

Create a Boolean object representing the value of the argument value. In general the use of the static method valueof(boolean) is more efficient since it will not create a new object.

Parameters:

See Also:


Boolean

public Boolean(java.lang.String s)

Creates a Boolean object representing the primitive true if and only if s matches the string "true" ignoring case, otherwise the object will represent the primitive false. In general the use of the static method valueof(String) is more efficient since it will not create a new object.

Parameters:


Method Details

booleanValue

public boolean booleanValue()

Return the primitive boolean value of this Boolean object.

Returns:


equals

public boolean equals(java.lang.Object obj)

If the obj is an instance of Boolean and has the same primitive value as this object then true is returned. In all other cases, including if the obj is null, false is returned.

Parameters:

Returns:


getBoolean

public static boolean getBoolean(java.lang.String name)

If the value of the system property name matches "true" ignoring case then the function returns true.

Parameters:

Returns:

Throws:

See Also:


hashCode

public int hashCode()

Returns the integer 1231 if this object represents the primitive true and the integer 1237 otherwise.

Returns:


toString

public String toString()

Returns "true" if the value of this object is true and returns "false" if the value of this object is false.

Returns:


toString

public static String toString(boolean b)

Returns "true" if the value of the give boolean is true and returns "false" if the value of the given boolean is false.

Since:Parameters:

Returns:


valueOf

public static Boolean valueOf(boolean b)

Returns the Boolean TRUE if the given boolean is true, otherwise it will return the Boolean FALSE.

Since:Parameters:

Returns:

See Also:


valueOf

public static Boolean valueOf(java.lang.String s)

Returns the Boolean TRUE if and only if the given String is equal, ignoring case, to the the String "true", otherwise it will return the Boolean FALSE.

Parameters:

Returns: