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