java::lang::Boolean Class Reference

Inheritance diagram for java::lang::Boolean:

Inheritance graph
java::lang::Object
[legend]
Collaboration diagram for java::lang::Boolean:

Collaboration graph
java::lang::Object
[legend]

List of all members.


Detailed Description

The Boolean class wraps a value of the primitive type boolean in an object.

An object of type Boolean contains a single field whose type is boolean.

In addition, this class provides many methods for converting a boolean to a String and a String to a boolean, as well as other constants and methods useful when dealing with a boolean.

Author:
Yuh-Jye Chang
Version:
1.38, 02/02/00
Since:
JDK1.0

Public Member Functions

 Boolean (jboolean _value=false)
 Allocates a Boolean object representing the value argument.
virtual jboolean booleanValue () const
 Returns the value of this Boolean object as a boolean primitive.
virtual jboolean equals (const Object &src) const
 Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.
virtual jboolean equals (const Boolean &src) const
 Returns true if and only if the argument is a Boolean object that represents the same boolean value as this object.
virtual jint hashCode () const
 Returns a hash code for this Boolean object.
String toString () const
 Returns a String object representing this Boolean's value.

Static Public Member Functions

static const String toString (jboolean b)
 Creates a string representation of the boolean argument If this argument represents the value true, a string equal to "true" is returned.
static jboolean parseBoolean (const String &s)
 Parses the string argument as a boolean value specified by the argument.
static const Boolean valueOf (const String &s)
 Assuming the specified String represents a boolean, returns a new Boolean object initialized to that value.

Constructor & Destructor Documentation

java::lang::Boolean::Boolean ( jboolean  _value = false  ) 

Allocates a Boolean object representing the value argument.

Parameters:
value the value of the Boolean.


Member Function Documentation

static const String java::lang::Boolean::toString ( jboolean  b  )  [static]

Creates a string representation of the boolean argument If this argument represents the value true, a string equal to "true" is returned.

Otherwise, a string equal to "false" is returned.

Returns:
a string representation of the boolean argument.

static jboolean java::lang::Boolean::parseBoolean ( const String s  )  [static]

Parses the string argument as a boolean value specified by the argument.

Returns:
the boolean represented by the string argument.
Exceptions:
NumberFormatException if the string does not contain a parsable integer.

static const Boolean java::lang::Boolean::valueOf ( const String s  )  [static]

Assuming the specified String represents a boolean, returns a new Boolean object initialized to that value.

Throws an exception if the String cannot be parsed as a boolean.

Parameters:
s the String containing the boolean
Returns:
the Boolean instance representing the parsed boolean value
Exceptions:
NumberFormatException If the String does not contain a parsable boolean.

virtual jboolean java::lang::Boolean::booleanValue (  )  const [virtual]

Returns the value of this Boolean object as a boolean primitive.

Returns:
the primitive boolean value of this object.

virtual jboolean java::lang::Boolean::equals ( const Object src  )  const [virtual]

Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.

Parameters:
obj the object to compare with.
Returns:
true if the Boolean objects represent the same value; false otherwise.

Reimplemented from java::lang::Object.

virtual jboolean java::lang::Boolean::equals ( const Boolean src  )  const [virtual]

Returns true if and only if the argument is a Boolean object that represents the same boolean value as this object.

Parameters:
src the Boolean to compare with.
Returns:
true if the Boolean objects represent the same value; false otherwise.

virtual jint java::lang::Boolean::hashCode (  )  const [virtual]

Returns a hash code for this Boolean object.

Returns:
the integer 1231 if this object represents true; returns the integer 1237 if this object represents false.

Reimplemented from java::lang::Object.

String java::lang::Boolean::toString (  )  const [virtual]

Returns a String object representing this Boolean's value.

If this object represents the value true, a string equal to "true" is returned. Otherwise, a string equal to "false" is returned.

Returns:
a string representation of this object.

Reimplemented from java::lang::Object.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:34 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3