|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable
|
+--EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean
A class useful for offloading synch for boolean instance variables.
[ Introduction to this package. ]
| Field Summary | |
protected boolean |
value_
|
| Fields inherited from class EDU.oswego.cs.dl.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,
java.lang.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(java.lang.Object other)
|
int |
compareTo(EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean other)
|
boolean |
complement()
Set the value to its complement |
boolean |
equals(java.lang.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(EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean other)
Atomically swap values with another SynchronizedBoolean. |
java.lang.String |
toString()
|
boolean |
xor(boolean b)
Set value to value ^ b. |
| Methods inherited from class EDU.oswego.cs.dl.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,
java.lang.Object lock)
| Method Detail |
public final boolean get()
public boolean set(boolean newValue)
public boolean commit(boolean assumedValue,
boolean newValue)
public boolean swap(EDU.oswego.cs.dl.util.concurrent.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(EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean other)
public int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparablepublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||