java.lang
Class Boolean

java.lang.Object
  extended by java.lang.Boolean

public final class Boolean
extends Object

Boolean is the wrapper for the primitive type boolean.

Since:
1.0

Field Summary
static Boolean FALSE
          The instance of the receiver which represents falsehood.
static Boolean TRUE
          The instance of the receiver which represents truth.
 
Constructor Summary
Boolean(boolean value)
          Constructs a new instance of this class given true or false.
Boolean(String string)
          Constructs a new instance of this class given a string.
 
Method Summary
 boolean booleanValue()
          Answers true if the receiver represents true and false if the receiver represents false.
 boolean equals(Object o)
          Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
 int hashCode()
          Answers an integer hash code for the receiver.
static boolean parseBoolean(String s)
           
 String toString()
          Answers a string containing a concise, human-readable description of the receiver.
static String toString(boolean value)
          Converts the specified boolean to its string representation.
 
Methods inherited from class java.lang.Object
clone, getClass, println
 

Field Detail

TRUE

public static final Boolean TRUE
The instance of the receiver which represents truth.


FALSE

public static final Boolean FALSE
The instance of the receiver which represents falsehood.

Constructor Detail

Boolean

public Boolean(String string)
Constructs a new instance of this class given a string. If the string is equal to "true" using a non-case sensitive comparison, the result will be a Boolean representing true, otherwise it will be a Boolean representing false. In the palcom version the string comparison is case sensitive.

Parameters:
string - The name of the desired boolean.

Boolean

public Boolean(boolean value)
Constructs a new instance of this class given true or false.

Parameters:
value - true or false.
Method Detail

booleanValue

public boolean booleanValue()
Answers true if the receiver represents true and false if the receiver represents false.

Returns:
true or false.

equals

public boolean equals(Object o)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.

In this case, the argument must also be a Boolean, and the receiver and argument must represent the same boolean value (i.e. both true or both false).

Overrides:
equals in class Object
Parameters:
o - the object to compare with this object
Returns:
true if the object is the same as this object false if it is different from this object
See Also:
hashCode()

hashCode

public int hashCode()
Answers an integer hash code for the receiver. Any two objects which answer true when passed to equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

toString

public String toString()
Answers a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
a printable representation for the receiver.

toString

public static String toString(boolean value)
Converts the specified boolean to its string representation. When the boolean is true answer "true", otherwise answer "false".

Parameters:
value - the boolean
Returns:
the boolean converted to a string

parseBoolean

public static boolean parseBoolean(String s)
Returns:
true if s is not null, and if it is equal to "true", ignoring case.