java.lang
public final class Boolean extends Object implements Serializable, Comparable<Boolean>
Boolean represent primitive
boolean values.
Since: 1.0
UNKNOWN: updated to 1.5
| Field Summary | |
|---|---|
| static Boolean | FALSE
This field is a Boolean object representing the
primitive value false. |
| static Boolean | TRUE
This field is a Boolean object representing the
primitive value true. |
| static Class<Boolean> | TYPE
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(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 | |
|---|---|
| boolean | booleanValue()
Return the primitive boolean value of this
Boolean object.
|
| int | compareTo(Boolean other)
Compares this Boolean to another.
|
| boolean | equals(Object obj)
If the obj is an instance of Boolean and
has the same primitive value as this object then true
is returned. |
| static boolean | getBoolean(String name)
If the value of the system property name matches
"true" ignoring case then the function returns true.
|
| int | hashCode()
Returns the integer 1231 if this object represents
the primitive true and the integer 1237
otherwise.
|
| static boolean | parseBoolean(String b)
If the String argument is "true", ignoring case, return true.
|
| 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.
|
| String | toString()
Returns "true" if the value of this object is true and
returns "false" if the value of this object is false.
|
| static Boolean | valueOf(boolean b)
Returns the Boolean TRUE if the given boolean is
true, otherwise it will return the Boolean
FALSE.
|
| static Boolean | valueOf(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.
|
Boolean object representing the
primitive value false. This instance is returned
by the static valueOf() methods if they return
a Boolean representing false.Boolean object representing the
primitive value true. This instance is returned
by the static valueOf() methods if they return
a Boolean representing true.boolean is represented by this
Class object.
Since: 1.1
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: value the primitive value of this Boolean
See Also: Boolean
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: s the String representation of true
or false
boolean value of this
Boolean object.
Returns: true or false, depending on the value of this Boolean
Parameters: other the Boolean to compare this Boolean to
Returns: 0 if both Booleans represent the same value, a positive number if this Boolean represents true and the other false, and a negative number otherwise.
Since: 1.5
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: obj possibly an instance of any Class
Returns: true if obj equals this
name matches
"true" ignoring case then the function returns true.
Parameters: name the property name to look up
Returns: true if the property resulted in "true"
Throws: SecurityException if accessing the system property is forbidden
See Also: getProperty
1231 if this object represents
the primitive true and the integer 1237
otherwise.
Returns: the hash code
Parameters: b String to parse
Since: 1.5
true and
returns "false" if the value of the given boolean is false.
Parameters: b the boolean to convert
Returns: the string representation of the boolean
Since: 1.4
true and
returns "false" if the value of this object is false.
Returns: the string representation of this
TRUE if the given boolean is
true, otherwise it will return the Boolean
FALSE.
Parameters: b the boolean to wrap
Returns: the wrapper object
Since: 1.4
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: s the string to convert
Returns: a wrapped boolean from the string