rebuild.util.ref
Class RefBoolean

java.lang.Object
  extended by rebuild.util.ref.RefBoolean

public final class RefBoolean
extends java.lang.Object

Reference Boolean is the same as Boolean but allows you to set the boolean without creating a new Boolean.

Since:
BBX 1.1.0

Field Summary
static RefBoolean FALSE
          The RefBoolean object corresponding to the primitive value false.
static RefBoolean TRUE
          The RefBoolean object corresponding to the primitive value true.
 
Constructor Summary
RefBoolean()
          Create a new RefBoolean set to the default of false.
RefBoolean(boolean value)
          Create a new RefBoolean using a boolean primitive.
RefBoolean(java.lang.Boolean value)
          Create a new RefBoolean using a Boolean.
RefBoolean(boolean value, boolean fixed)
          Create a new RefBoolean using a boolean primitive.
RefBoolean(java.lang.Boolean value, boolean fixed)
          Create a new RefBoolean using a Boolean.
 
Method Summary
 boolean booleanValue()
          Returns The value of this RefBoolean object as a boolean primitive.
 RefBoolean clone()
          Create a clone of the current object.
 boolean equals(java.lang.Object obj)
          Returns true if and only if the argument is not null and is a RefBoolean or Boolean object that represents the same boolean value as this object.
 int hashCode()
          Returns a hash code for this RefBoolean object.
 boolean isReadOnly()
          If this RefBoolean is read only.
 RefBoolean setValue(boolean value)
          Set the value of this RefBoolean object with a boolean primitive.
 RefBoolean setValue(java.lang.Boolean value)
          Set the value of this RefBoolean object with a Boolean.
 void toggle()
          Toggle the boolean value.
 java.lang.String toString()
          Returns a String object representing this RefBoolean's value.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FALSE

public static final RefBoolean FALSE
The RefBoolean object corresponding to the primitive value false.


TRUE

public static final RefBoolean TRUE
The RefBoolean object corresponding to the primitive value true.

Constructor Detail

RefBoolean

public RefBoolean()
Create a new RefBoolean set to the default of false.


RefBoolean

public RefBoolean(boolean value)
Create a new RefBoolean using a boolean primitive.

Parameters:
value - The boolean primitive to set this RefBoolean with.

RefBoolean

public RefBoolean(boolean value,
                  boolean fixed)
Create a new RefBoolean using a boolean primitive.

Parameters:
value - The boolean primitive to set this RefBoolean with.
fixed - If this item is read only and cannot be modified.

RefBoolean

public RefBoolean(java.lang.Boolean value)
Create a new RefBoolean using a Boolean.

Parameters:
value - The Boolean to set this RefBoolean with.

RefBoolean

public RefBoolean(java.lang.Boolean value,
                  boolean fixed)
Create a new RefBoolean using a Boolean.

Parameters:
value - The Boolean to set this RefBoolean with.
fixed - If this item is read only and cannot be modified.
Method Detail

isReadOnly

public boolean isReadOnly()
If this RefBoolean is read only.

Returns:
true if this RefBoolean is read only, false if otherwise.

booleanValue

public boolean booleanValue()
Returns The value of this RefBoolean object as a boolean primitive.

Returns:
The primitive boolean value of this object.

setValue

public RefBoolean setValue(boolean value)
Set the value of this RefBoolean object with a boolean primitive.

Parameters:
value - The primitive boolean value to set this object.
Returns:
This object.

setValue

public RefBoolean setValue(java.lang.Boolean value)
Set the value of this RefBoolean object with a Boolean.

Parameters:
value - The Boolean value to set this object.
Returns:
This object.

equals

public boolean equals(java.lang.Object obj)
Returns true if and only if the argument is not null and is a RefBoolean 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 RefBoolean objects represent the same value; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this RefBoolean 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.

toString

public java.lang.String toString()
Returns a String object representing this RefBoolean's value.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.

clone

public RefBoolean clone()
Create a clone of the current object.

Returns:
A clone of the current RefBoolean.

toggle

public void toggle()
Toggle the boolean value.