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