EDU.oswego.cs.dl.util.concurrent
public class SynchronizedBoolean extends SynchronizedVariable implements Comparable, Cloneable
Field Summary | |
---|---|
protected boolean | value_ |
Constructor Summary | |
---|---|
SynchronizedBoolean(boolean initialValue)
Make a new SynchronizedBoolean with the given initial value,
and using its own internal lock.
| |
SynchronizedBoolean(boolean initialValue, Object lock)
Make a new SynchronizedBoolean with the given initial value,
and using the supplied lock.
|
Method Summary | |
---|---|
boolean | and(boolean b)
Set value to value & b. |
boolean | commit(boolean assumedValue, boolean newValue)
Set value to newValue only if it is currently assumedValue. |
int | compareTo(boolean other) |
int | compareTo(SynchronizedBoolean other) |
int | compareTo(Object other) |
boolean | complement()
Set the value to its complement |
boolean | equals(Object other) |
boolean | get()
Return the current value
|
int | hashCode() |
boolean | or(boolean b)
Set value to value | b. |
boolean | set(boolean newValue)
Set to newValue. |
boolean | swap(SynchronizedBoolean other)
Atomically swap values with another SynchronizedBoolean.
|
String | toString() |
boolean | xor(boolean b)
Set value to value ^ b. |
Returns: the new value
Returns: true if successful
Returns: the new value
Returns: the new value
Returns: the old value
Returns: the new value
Returns: the new value