站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

MuBoolean (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util
Class MuBoolean

java.lang.Object
  extended byorg.jboss.util.MuBoolean
All Implemented Interfaces:
Cloneable, Comparable, Mutable, Serializable

public class MuBoolean
extends Object
implements Comparable, Cloneable, Serializable, Mutable

A mutable boolean class.

Version:
$Revision: 1.1 $
Author:
Jason Dillon
See Also:
Serialized Form

Constructor Summary
MuBoolean()
          Construct a new mutable boolean.
MuBoolean(boolean b)
          Construct a new mutable boolean.
MuBoolean(Object obj)
          Construct a new mutable boolean.
MuBoolean(String value)
          Construct a new mutable boolean.
 
Method Summary
 boolean and(boolean b)
          ANDs the current value with the specified value.
 boolean booleanValue()
          Return the value of this mutable boolean.
 Object clone()
          Clone this mutable boolean.
 boolean commit(boolean assumed, boolean b)
          Set the value to value only if the current value is equal to the assumed value.
 int compareTo(boolean bool)
          Compares this object with the specified boolean for order.
 int compareTo(Object obj)
          Compares this object with the specified object for order.
 boolean complement()
          Set the value to its complement.
 boolean equals(Object obj)
          Test the equality of another object.
 boolean get()
          Get the current value.
 Object getValue()
          Get the boolean value of this mutable boolean.
 int hashCode()
          Return the hash code for this mutable boolean.
 boolean or(boolean b)
          ORs the current value with the specified value.
 boolean set(boolean b)
          Set the value.
 boolean set(Boolean b)
          Set the value.
 boolean set(MuBoolean b)
          Set the value.
 void setValue(Object obj)
          Set the value of this mutable boolean.
 boolean swap(MuBoolean b)
          Swap values with another mutable boolean.
 String toString()
          Convert to a string.
 boolean xor(boolean b)
          XORs the current value with the specified value.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MuBoolean

public MuBoolean()
Construct a new mutable boolean.


MuBoolean

public MuBoolean(boolean b)
Construct a new mutable boolean.

Parameters:
b - Boolean value.

MuBoolean

public MuBoolean(Object obj)
Construct a new mutable boolean.

Parameters:
obj - Object to convert to a boolean value.

MuBoolean

public MuBoolean(String value)
Construct a new mutable boolean.

Parameters:
value - String to convert to a boolean value.
Method Detail

booleanValue

public boolean booleanValue()
Return the value of this mutable boolean.

Returns:
Boolean value.

set

public boolean set(boolean b)
Set the value.

Parameters:
b - Boolean value.
Returns:
The previous value.

set

public boolean set(Boolean b)
Set the value.

Parameters:
b - Boolean value.
Returns:
The previous value.

set

public boolean set(MuBoolean b)
Set the value.

Parameters:
b - Boolean value.
Returns:
The previous value.

get

public boolean get()
Get the current value.

Returns:
The current value.

commit

public boolean commit(boolean assumed,
                      boolean b)
Set the value to value only if the current value is equal to the assumed value.

Parameters:
assumed - The assumed value.
b - The new value.
Returns:
True if value was changed.

swap

public boolean swap(MuBoolean b)
Swap values with another mutable boolean.

Parameters:
b - Mutable boolean to swap values with.
Returns:
The new value.

complement

public boolean complement()
Set the value to its complement.

Returns:
The new value.

and

public boolean and(boolean b)
ANDs the current value with the specified value.

Parameters:
b - Value to and with.
Returns:
The new value.

or

public boolean or(boolean b)
ORs the current value with the specified value.

Parameters:
b - Value to or with.
Returns:
The new value.

xor

public boolean xor(boolean b)
XORs the current value with the specified value.

Parameters:
b - Value to xor with.
Returns:
The new value.

compareTo

public int compareTo(boolean bool)
Compares this object with the specified boolean for order.

Parameters:
bool - Boolean to compare with.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

compareTo

public int compareTo(Object obj)
              throws ClassCastException
Compares this object with the specified object for order.

Specified by:
compareTo in interface Comparable
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - Object is not a MuBoolean.

toString

public String toString()
Convert to a string.

Returns:
String value

hashCode

public int hashCode()
Return the hash code for this mutable boolean.

Returns:
Hash code

equals

public boolean equals(Object obj)
Test the equality of another object.

Parameters:
obj - Object to test equality with.
Returns:
True if object is equal to this.

clone

public Object clone()
Clone this mutable boolean.

Returns:
Cloned mutable boolean.

setValue

public void setValue(Object obj)
Set the value of this mutable boolean.

If value is a java.lang.Boolean, then use Boolean.booleanValue() to determin value, if the object is non-null then the value is true, else it is false.

Specified by:
setValue in interface Mutable
Parameters:
obj - Object to convert to a boolean value.

getValue

public Object getValue()
Get the boolean value of this mutable boolean.

Specified by:
getValue in interface Mutable
Returns:
java.lang.Boolean value.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.