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