|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdiagnose.concurrent.SynchronizedVariable org.jdiagnose.concurrent.SynchronizedLong
A class useful for offloading synch for long instance variables.
[ Introduction to this package. ]
Field Summary | |
protected long |
value_
|
Fields inherited from class org.jdiagnose.concurrent.SynchronizedVariable |
lock_ |
Constructor Summary | |
SynchronizedLong(long initialValue)
Make a new SynchronizedLong with the given initial value, and using its own internal lock. |
|
SynchronizedLong(long initialValue,
java.lang.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(java.lang.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(java.lang.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. |
java.lang.String |
toString()
|
long |
xor(long b)
Set value to value ^ b. |
Methods inherited from class org.jdiagnose.concurrent.SynchronizedVariable |
execute, getLock |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected long value_
Constructor Detail |
public SynchronizedLong(long initialValue)
public SynchronizedLong(long initialValue, java.lang.Object lock)
Method Detail |
public final long get()
public long set(long newValue)
public boolean commit(long assumedValue, long newValue)
public long swap(SynchronizedLong other)
public long increment()
public long decrement()
public long add(long amount)
public long subtract(long amount)
public long multiply(long factor)
public long divide(long factor)
public long negate()
public long complement()
public long and(long b)
public long or(long b)
public long xor(long b)
public int compareTo(long other)
public int compareTo(SynchronizedLong other)
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |