java.lang
Class Boolean
- Comparable<T>, Serializable
Instances of class Boolean
represent primitive
boolean
values.
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 | TYPE - The primitive type
boolean is represented by this
Class object.
|
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 .
|
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.
|
String | toString() - Returns "true" if the value of this object is
true and
returns "false" if the value of this object is false .
|
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 .
|
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 .
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
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.
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.
value
- the primitive value of this Boolean
Boolean
public 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
. In general the use of the static
method valueof(String)
is more efficient since it will
not create a new object.
s
- the String
representation of true
or false
booleanValue
public boolean booleanValue()
Return the primitive boolean
value of this
Boolean
object.
- true or false, depending on the value of this Boolean
compareTo
public int compareTo(Boolean other)
Compares this Boolean to another.
other
- the Boolean to compare this Boolean to
- 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.
equals
public 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. In all other cases, including if the obj
is null
, false
is returned.
- equals in interface Object
obj
- possibly an instance of any Class
getBoolean
public static boolean getBoolean(String name)
If the value of the system property name
matches
"true" ignoring case then the function returns true
.
name
- the property name to look up
- true if the property resulted in "true"
hashCode
public int hashCode()
Returns the integer 1231
if this object represents
the primitive true
and the integer 1237
otherwise.
- hashCode in interface Object
parseBoolean
public static boolean parseBoolean(String b)
If the String argument is "true", ignoring case, return true.
Otherwise, return false.
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
.
- toString in interface Object
- the string representation of this
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
.
b
- the boolean to convert
- the string representation of the boolean
valueOf
public static Boolean valueOf(boolean b)
Returns the Boolean TRUE
if the given boolean is
true
, otherwise it will return the Boolean
FALSE
.
valueOf
public 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
.
s
- the string to convert
- a wrapped boolean from the string
Boolean.java -- object wrapper for boolean
Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.