com.isti.util
Class BooleanCp

java.lang.Object
  extended byjava.lang.Number
      extended bycom.isti.util.BooleanCp
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class BooleanCp
extends java.lang.Number
implements java.lang.Comparable, java.io.Serializable

Class BooleanCp is a 'Boolean'-like wrapper class which holds a boolean value and implements the Comparable interface.

See Also:
Serialized Form

Constructor Summary
BooleanCp(boolean value)
          Allocates a BooleanCp object representing the value argument.
BooleanCp(java.lang.Boolean bObj)
          Allocates a BooleanCp object which holds the given Boolean object.
BooleanCp(java.lang.String str)
          Allocates a BooleanCp object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true".
 
Method Summary
 boolean booleanValue()
          Returns the value of this BooleanCp object as a boolean primitive.
 byte byteValue()
          Returns the value of this object as a byte.
 int compareTo(java.lang.Object obj)
          Compares this object with the specified object 'obj'.
 double doubleValue()
          Returns the value of this object as a double.
 boolean equals(java.lang.Object obj)
          Returns true if and only if the argument is not null and is a BooleanCp or Boolean object that represents the same boolean value as this object.
 float floatValue()
          Returns the value of this object as a float.
 java.lang.Boolean getBooleanObj()
          Returns the handle of the Boolean object held by this object.
 int hashCode()
          Returns a hash code for this BooleanCp object.
 int intValue()
          Returns the value of this object as an int.
 long longValue()
          Returns the value of this object as a long.
 short shortValue()
          Returns the value of this object as a short.
 java.lang.String toString()
          Returns a String object representing this BooleanCp's value.
static BooleanCp valueOf(java.lang.String s)
          Returns the boolean value represented by the specified String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanCp

public BooleanCp(boolean value)
Allocates a BooleanCp object representing the value argument.

Parameters:
value - the value of the BooleanCp.

BooleanCp

public BooleanCp(java.lang.String str)
Allocates a BooleanCp object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true". Otherwise, allocate a Boolean object representing the value false. Examples: new BooleanCp("True") produces a BooleanCp object that represents true. new BooleanCp("yes") produces a BooleanCp object that represents false.

Parameters:
str - the string to be converted to a BooleanCp.

BooleanCp

public BooleanCp(java.lang.Boolean bObj)
Allocates a BooleanCp object which holds the given Boolean object.

Parameters:
bObj - the value of the BooleanCp.
Method Detail

getBooleanObj

public java.lang.Boolean getBooleanObj()
Returns the handle of the Boolean object held by this object.

Returns:
boolean object

booleanValue

public boolean booleanValue()
Returns the value of this BooleanCp object as a boolean primitive.

Returns:
The primitive boolean value of this object.

valueOf

public static BooleanCp valueOf(java.lang.String s)
Returns the boolean value represented by the specified String. A new BooleanCp object is constructed. This BooleanCp represents the value true if the string argument is not null and is equal, ignoring case, to the string "true". Example: BooleanCp.valueOf("True") returns true. Example: BooleanCp.valueOf("yes") returns false.

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

toString

public java.lang.String toString()
Returns a String object representing this BooleanCp'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.

hashCode

public int hashCode()
Returns a hash code for this BooleanCp object.

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

equals

public boolean equals(java.lang.Object obj)
Returns true if and only if the argument is not null and is a BooleanCp or 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.

intValue

public int intValue()
Returns the value of this object as an int.

Returns:
integer value

longValue

public long longValue()
Returns the value of this object as a long.

Returns:
long value

floatValue

public float floatValue()
Returns the value of this object as a float.

Returns:
float value

doubleValue

public double doubleValue()
Returns the value of this object as a double.

Returns:
double value

byteValue

public byte byteValue()
Returns the value of this object as a byte.

Returns:
byte value

shortValue

public short shortValue()
Returns the value of this object as a short.

Returns:
short value

compareTo

public int compareTo(java.lang.Object obj)
Compares this object with the specified object 'obj'. 'false' is considered to be "less than" 'true'.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - an object to compare to.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this object.