aicas logoJamaica 3.2 release 62

java.lang
Class Boolean

java.lang.Object
  extended by java.lang.Boolean
All Implemented Interfaces:
Serializable, Comparable<Boolean>

public final class Boolean
extends Object
implements Serializable, Comparable<Boolean>

Boolean provides class for boolean values stored in objects.

Since:
1.0
See Also:
Serialized Form

Field Summary
static Boolean FALSE
          default instance representing the boolean value false.
static Boolean TRUE
          default instance representing the boolean value true.
static Class<Boolean> TYPE
          type for boolean.
 
Constructor Summary
Boolean(boolean value)
          Constructor for an instance of Boolean with the given value
Boolean(String s)
          Constructor for an instance of Boolean with the value taken from a string.
 
Method Summary
 boolean booleanValue()
          booleanValue return the boolean value represented by this.
 int compareTo(Boolean b)
          compareTo compares this boolean value to the argument b.
 boolean equals(Object obj)
          equals compares this to obj
static boolean getBoolean(String name)
          getBoolean determines the value of a given boolean property.
 int hashCode()
          hashCode determines a hashcode for this instance.
static boolean parseBoolean(String s)
          parseBoolean parses a string as a boolean value.
 String toString()
          toString converts the value represented by this as a string.
static String toString(boolean b)
          toString converts the value represented by the parameter b to a string.
static Boolean valueOf(boolean b)
          valueOf returns a boolean instance representing the given boolean value.
static Boolean valueOf(String s)
          valueOf returns a boolean instance representing the boolean value given obtained by parseBoolean(s) for the given string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final Boolean TRUE
default instance representing the boolean value true.


FALSE

public static final Boolean FALSE
default instance representing the boolean value false.


TYPE

public static final Class<Boolean> TYPE
type for boolean.

Since:
1.1
Constructor Detail

Boolean

public Boolean(boolean value)
Constructor for an instance of Boolean with the given value

Parameters:
value - the value the instance represents.

Boolean

public Boolean(String s)
Constructor for an instance of Boolean with the value taken from a string.

Parameters:
s - the string, if s is not null and s.compareToIgnoreCase("true") returns true, the value will be true, else the value will be false.
Method Detail

parseBoolean

public static boolean parseBoolean(String s)
parseBoolean parses a string as a boolean value.

Parameters:
s - the string or null.
Returns:
true if s is not null and s.compareToIgnoreCase("true") returns true, false otherwise.
Since:
1.5

compareTo

public int compareTo(Boolean b)
compareTo compares this boolean value to the argument b.

Specified by:
compareTo in interface Comparable<Boolean>
Parameters:
b - another boolean value.
Returns:
0 if this and b represent the same value, +1 if this is true and b is false, -1 if this if false and b is true.
Since:
1.5

booleanValue

public boolean booleanValue()
booleanValue return the boolean value represented by this.

Returns:
the value.

valueOf

public static Boolean valueOf(String s)
valueOf returns a boolean instance representing the boolean value given obtained by parseBoolean(s) for the given string.

Parameters:
s - the string.
Returns:
an instance equal to parseBoolean(s)

valueOf

public static Boolean valueOf(boolean b)
valueOf returns a boolean instance representing the given boolean value. This method will not allocate new instances, but return TRUE or FALSE for b and !b, respectively.

Parameters:
b - the value.
Returns:
an instance with equal value to b.
Since:
1.4

toString

public String toString()
toString converts the value represented by this as a string.

Overrides:
toString in class Object
Returns:
"true" if this represents the value true, "false" otherwise.

toString

public static String toString(boolean b)
toString converts the value represented by the parameter b to a string.

Parameters:
b - the value to be converted.
Returns:
"true" if b==true, "false" otherwise.
Since:
1.4

hashCode

public int hashCode()
hashCode determines a hashcode for this instance.

Overrides:
hashCode in class Object
Returns:
1231 if this represents true, 1237 otherwise.

equals

public boolean equals(Object obj)
equals compares this to obj

Overrides:
equals in class Object
Parameters:
obj - another object.
Returns:
true iff obj is an instance of Boolean that represents the same value.

getBoolean

public static boolean getBoolean(String name)
getBoolean determines the value of a given boolean property.

Parameters:
name - the name of the property.
Returns:
true if the boolean property is present and set to "true" (using case-insensitive comparison), false otherwise.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.