com.isti.util
Class ModBoolean

java.lang.Object
  extended by java.lang.Number
      extended by com.isti.util.ModBoolean
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class ModBoolean
extends java.lang.Number
implements java.lang.Comparable

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

See Also:
Serialized Form

Field Summary
protected  boolean booleanVal
           
 
Constructor Summary
ModBoolean(boolean value)
          Allocates a ModBoolean object representing the value argument.
ModBoolean(java.lang.Boolean bObj)
          Allocates a ModBoolean object which holds the given Boolean object.
ModBoolean(java.lang.String str)
          Allocates a ModBoolean 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 ModBoolean 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 ModBoolean, BooleanCp or Boolean object that represents the same boolean value as this object.
 float floatValue()
          Returns the value of this object as a float.
 boolean getValue()
          Returns the value of this ModBoolean object as a boolean primitive.
 int hashCode()
          Returns a hash code for this ModBoolean object.
 int intValue()
          Returns the value of this object as an int.
 long longValue()
          Returns the value of this object as a long.
 void setValue(boolean val)
          Sets the value of this ModBoolean object.
 short shortValue()
          Returns the value of this object as a short.
 java.lang.String toString()
          Returns a String object representing this ModBoolean's value.
static ModBoolean 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
 

Field Detail

booleanVal

protected boolean booleanVal
Constructor Detail

ModBoolean

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

Parameters:
value - the value of the ModBoolean.

ModBoolean

public ModBoolean(java.lang.String str)
Allocates a ModBoolean 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 ModBoolean("True") produces a ModBoolean object that represents true. new ModBoolean("yes") produces a ModBoolean object that represents false.

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

ModBoolean

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

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

setValue

public void setValue(boolean val)
Sets the value of this ModBoolean object.

Parameters:
val - boolean value to be set.

getValue

public boolean getValue()
Returns the value of this ModBoolean object as a boolean primitive.

Returns:
The primitive boolean value of this object.

booleanValue

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

Returns:
The primitive boolean value of this object.

valueOf

public static ModBoolean valueOf(java.lang.String s)
Returns the boolean value represented by the specified String. A new ModBoolean object is constructed. This ModBoolean represents the value true if the string argument is not null and is equal, ignoring case, to the string "true". Example: ModBoolean.valueOf("True") returns true. Example: ModBoolean.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 ModBoolean'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 java.lang.Object
Returns:
A string representation of this object.

hashCode

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

Overrides:
hashCode in class java.lang.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 ModBoolean, BooleanCp or Boolean object that represents the same boolean value as this object.

Overrides:
equals in class java.lang.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.

Specified by:
intValue in class java.lang.Number
Returns:
integer value

longValue

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

Specified by:
longValue in class java.lang.Number
Returns:
long value

floatValue

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

Specified by:
floatValue in class java.lang.Number
Returns:
float value

doubleValue

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

Specified by:
doubleValue in class java.lang.Number
Returns:
double value

byteValue

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

Overrides:
byteValue in class java.lang.Number
Returns:
byte value

shortValue

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

Overrides:
shortValue in class java.lang.Number
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.