|
Colt 1.0.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.oswego.cs.dl.util.concurrent.SynchronizedVariable | +--edu.oswego.cs.dl.util.concurrent.SynchronizedInt
A class useful for offloading synch for int instance variables.
[ Introduction to this package. ]
Constructor Summary | |
SynchronizedInt(int initialValue)
Make a new SynchronizedInt with the given initial value, and using its own internal lock. |
|
SynchronizedInt(int initialValue,
Object lock)
Make a new SynchronizedInt with the given initial value, and using the supplied lock. |
Method Summary | |
int |
add(int amount)
Add amount to value (i.e., set value += amount) |
int |
and(int b)
Set value to value & b. |
boolean |
commit(int assumedValue,
int newValue)
Set value to newValue only if it is currently assumedValue. |
int |
compareTo(int other)
|
int |
compareTo(Object other)
|
int |
compareTo(SynchronizedInt other)
|
int |
complement()
Set the value to its complement |
int |
decrement()
Decrement the value. |
int |
divide(int factor)
Divide value by factor (i.e., set value /= factor) |
boolean |
equals(Object other)
|
int |
get()
Return the current value |
int |
hashCode()
|
int |
increment()
Increment the value. |
int |
multiply(int factor)
Multiply value by factor (i.e., set value *= factor) |
int |
negate()
Set the value to the negative of its old value |
int |
or(int b)
Set value to value | b. |
int |
set(int newValue)
Set to newValue. |
int |
subtract(int amount)
Subtract amount from value (i.e., set value -= amount) |
int |
swap(SynchronizedInt other)
Atomically swap values with another SynchronizedInt. |
String |
toString()
|
int |
xor(int 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 |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SynchronizedInt(int initialValue)
public SynchronizedInt(int initialValue, Object lock)
Method Detail |
public int add(int amount)
public int and(int b)
public boolean commit(int assumedValue, int newValue)
public int compareTo(int other)
public int compareTo(SynchronizedInt other)
public int compareTo(Object other)
compareTo
in interface Comparable
public int complement()
public int decrement()
public int divide(int factor)
public boolean equals(Object other)
equals
in class Object
public final int get()
public int hashCode()
hashCode
in class Object
public int increment()
public int multiply(int factor)
public int negate()
public int or(int b)
public int set(int newValue)
public int subtract(int amount)
public int swap(SynchronizedInt other)
public String toString()
toString
in class Object
public int xor(int b)
|
Colt 1.0.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |