|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectau.gov.tas.dpiwe.mr.util.concurrent.SynchronizedVariable
au.gov.tas.dpiwe.mr.util.concurrent.SynchronizedBoolean
public class SynchronizedBoolean
A class useful for offloading synch for boolean instance variables.
[ Doug Lea's introduction to this package. ]
| Field Summary | |
|---|---|
protected boolean |
value_
|
| Fields inherited from class au.gov.tas.dpiwe.mr.util.concurrent.SynchronizedVariable |
|---|
lock_ |
| 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(Object other)
|
int |
compareTo(SynchronizedBoolean 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. |
| Methods inherited from class au.gov.tas.dpiwe.mr.util.concurrent.SynchronizedVariable |
|---|
execute, getLock |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean value_
| Constructor Detail |
|---|
public SynchronizedBoolean(boolean initialValue)
public SynchronizedBoolean(boolean initialValue,
Object lock)
| Method Detail |
|---|
public final boolean get()
public boolean set(boolean newValue)
public boolean commit(boolean assumedValue,
boolean newValue)
public boolean swap(SynchronizedBoolean other)
public boolean complement()
public boolean and(boolean b)
public boolean or(boolean b)
public boolean xor(boolean b)
public int compareTo(boolean other)
public int compareTo(SynchronizedBoolean other)
public int compareTo(Object other)
compareTo in interface Comparablepublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||