| java.lang.Object clime.messadmin.utils.ComparableBoolean
ComparableBoolean | final public class ComparableBoolean implements Serializable,Comparable(Code) | | Comparable Boolean for JDK <= 1.4. Useless for JDK 5.
Note that some static methods have been removed, as they where already defined in Boolean.
This class is not intended as a replacement for java.lang.Boolean!
(From the JDK documentation:)
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: Arthur van Hoff, Cédrik LIME version: 1.51, 05/11/04 since: JDK1.0 |
Field Summary | |
final public static ComparableBoolean | FALSE The ComparableBoolean object corresponding to the primitive
value false . | final public static ComparableBoolean | TRUE The ComparableBoolean object corresponding to the primitive
value true . | final public static Class | TYPE The Class object representing the primitive type boolean. |
Method Summary | |
public boolean | booleanValue() Returns the value of this ComparableBoolean object as a boolean
primitive. | public int | compareTo(Object o) Compares this ComparableBoolean instance with another. | public boolean | equals(Object obj) Returns true if and only if the argument is not
null and is a ComparableBoolean object that
represents the same boolean value as this object. | public int | hashCode() Returns a hash code for this ComparableBoolean object.
the integer 1231 if this object represents true; returns the integer 1237 if this object represents false. | public String | toString() Returns a String object representing this ComparableBoolean's
value. | public static ComparableBoolean | valueOf(boolean b) Returns a ComparableBoolean instance representing the specified
boolean value. |
FALSE | final public static ComparableBoolean FALSE(Code) | | The ComparableBoolean object corresponding to the primitive
value false .
|
TRUE | final public static ComparableBoolean TRUE(Code) | | The ComparableBoolean object corresponding to the primitive
value true .
|
TYPE | final public static Class TYPE(Code) | | The Class object representing the primitive type boolean.
since: JDK1.1 |
booleanValue | public boolean booleanValue()(Code) | | Returns the value of this ComparableBoolean object as a boolean
primitive.
the primitive boolean value of this object. |
compareTo | public int compareTo(Object o)(Code) | | Compares this ComparableBoolean instance with another.
Parameters: o - the ComparableBoolean or Boolean instance to be compared zero if this object represents the same boolean value as theargument; a positive value if this object represents trueand the argument represents false; and a negative value ifthis object represents false and the argument represents true throws: NullPointerException - if the argument is null See Also: Comparable since: 1.5 |
equals | public boolean equals(Object obj)(Code) | | Returns true if and only if the argument is not
null and is a ComparableBoolean object that
represents the same boolean value as this object.
Parameters: obj - the object to compare with. true if the Boolean objects represent the same value; false otherwise. |
hashCode | public int hashCode()(Code) | | Returns a hash code for this ComparableBoolean object.
the integer 1231 if this object represents true; returns the integer 1237 if this object represents false. |
toString | public String toString()(Code) | | Returns a String object representing this ComparableBoolean's
value. If this object represents the value true ,
a string equal to "true" is returned. Otherwise, a
string equal to "false" is returned.
a string representation of this object. |
valueOf | public static ComparableBoolean valueOf(boolean b)(Code) | | Returns a ComparableBoolean instance representing the specified
boolean value. If the specified boolean value
is true, this method returns ComparableBoolean.TRUE;
if it is false, this method returns ComparableBoolean.FALSE.
If a new ComparableBoolean instance is not required, this method
should generally be used in preference to the constructor
ComparableBoolean.ComparableBoolean(boolean) , as this method is likely to yield
significantly better space and time performance.
Parameters: b - a boolean value. a ComparableBoolean instance representing b. since: 1.4 |
|
|