| java.lang.Object EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable EDU.oswego.cs.dl.util.concurrent.SynchronizedLong
All known Subclasses: EDU.oswego.cs.dl.util.concurrent.WaitableLong,
Field Summary | |
protected long | value_ |
Constructor Summary | |
public | SynchronizedLong(long initialValue) Make a new SynchronizedLong with the given initial value,
and using its own internal lock. | public | SynchronizedLong(long initialValue, Object lock) Make a new SynchronizedLong with the given initial value,
and using the supplied lock. |
value_ | protected long value_(Code) | | |
SynchronizedLong | public SynchronizedLong(long initialValue)(Code) | | Make a new SynchronizedLong with the given initial value,
and using its own internal lock.
|
SynchronizedLong | public SynchronizedLong(long initialValue, Object lock)(Code) | | Make a new SynchronizedLong with the given initial value,
and using the supplied lock.
|
add | public long add(long amount)(Code) | | Add amount to value (i.e., set value += amount)
the new value |
and | public long and(long b)(Code) | | Set value to value & b.
the new value |
commit | public boolean commit(long assumedValue, long newValue)(Code) | | Set value to newValue only if it is currently assumedValue.
true if successful |
compareTo | public int compareTo(long other)(Code) | | |
complement | public long complement()(Code) | | Set the value to its complement
the new value |
decrement | public long decrement()(Code) | | Decrement the value.
the new value |
divide | public long divide(long factor)(Code) | | Divide value by factor (i.e., set value /= factor)
the new value |
get | final public long get()(Code) | | Return the current value
|
hashCode | public int hashCode()(Code) | | |
increment | public long increment()(Code) | | Increment the value.
the new value |
multiply | public synchronized long multiply(long factor)(Code) | | Multiply value by factor (i.e., set value *= factor)
the new value |
negate | public long negate()(Code) | | Set the value to the negative of its old value
the new value |
or | public long or(long b)(Code) | | Set value to value | b.
the new value |
set | public long set(long newValue)(Code) | | Set to newValue.
the old value |
subtract | public long subtract(long amount)(Code) | | Subtract amount from value (i.e., set value -= amount)
the new value |
swap | public long swap(SynchronizedLong other)(Code) | | Atomically swap values with another SynchronizedLong.
Uses identityHashCode to avoid deadlock when
two SynchronizedLongs attempt to simultaneously swap with each other.
the new value |
xor | public long xor(long b)(Code) | | Set value to value ^ b.
the new value |
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable | final protected Object lock_(Code)(Java Doc)
|
|
|