moka.lang
Class Boolean

java.lang.Object
  |
  +--moka.lang.Object
        |
        +--moka.lang.Boolean

public class Boolean
extends Object

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 several methods for converting an boolean to a String and a String to an boolean, as well as other constants and methods useful when dealing with an boolean.

Since:
MDK1.0a

Constructor Summary
Boolean(boolean value)
          Constructs a newly allocated Boolean object that represents the primitive boolean argument.
Boolean(moka.lang.String s)
          Constructs a newly allocated Boolean object that represents the value represented by the string.
 
Method Summary
 boolean booleanValue()
          Returns the value of this Boolean as a boolean.
 boolean equals(moka.lang.Object obj)
          Compares this object to the specified object.
static int parseBoolean(moka.lang.String s)
          Returns a Boolean with a value represented by the specified String.
 moka.lang.String toString()
          Returns a String object representing this Boolean's value.
 
Methods inherited from class moka.lang.Object
finalize, getClassName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Boolean

public Boolean(boolean value)
Constructs a newly allocated Boolean object that represents the primitive boolean argument.

Parameters:
value - the value to be represented by the Boolean.

Boolean

public Boolean(moka.lang.String s)
Constructs a newly allocated Boolean object that represents the value represented by the string. The string is converted to an boolean in exactly the manner used by the parseBoolean method.

Parameters:
s - the String to be converted to an Boolean.
Method Detail

toString

public moka.lang.String toString()
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.

Overrides:
toString in class Object
Returns:
a string representation of the value of this object.

equals

public boolean equals(moka.lang.Object obj)
Compares this object to the specified object. The result is true if and only if the argument is not null and is an Boolean object that contains the same boolean value as this object.

Overrides:
equals in class Object
Parameters:
obj - the object to compare with.
Returns:
true if the objects are the same; false otherwise.

booleanValue

public boolean booleanValue()
Returns the value of this Boolean as a boolean.


parseBoolean

public static int parseBoolean(moka.lang.String s)
Returns a Boolean with a value represented by the specified String. The Boolean returned represents the value true if the string argument is not null and is equal to the string "true". The string argument is finalized before the method returns.

Parameters:
s - a String
Returns:
the Boolean value represented by the string.