EDU.oswego.cs.dl.util.concurrent
public class SynchronizedChar extends SynchronizedVariable implements Comparable, Cloneable
| Field Summary | |
|---|---|
| protected char | value_ |
| Constructor Summary | |
|---|---|
| SynchronizedChar(char initialValue)
Make a new SynchronizedChar with the given initial value,
and using its own internal lock.
| |
| SynchronizedChar(char initialValue, Object lock)
Make a new SynchronizedChar with the given initial value,
and using the supplied lock.
| |
| Method Summary | |
|---|---|
| char | add(char amount)
Add amount to value (i.e., set value += amount) |
| boolean | commit(char assumedValue, char newValue)
Set value to newValue only if it is currently assumedValue. |
| int | compareTo(char other) |
| int | compareTo(SynchronizedChar other) |
| int | compareTo(Object other) |
| char | divide(char factor)
Divide value by factor (i.e., set value /= factor) |
| boolean | equals(Object other) |
| char | get()
Return the current value
|
| int | hashCode() |
| char | multiply(char factor)
Multiply value by factor (i.e., set value *= factor) |
| char | set(char newValue)
Set to newValue. |
| char | subtract(char amount)
Subtract amount from value (i.e., set value -= amount) |
| char | swap(SynchronizedChar other)
Atomically swap values with another SynchronizedChar.
|
| String | toString() |
Returns: the new value
Returns: true if successful
Returns: the new value
Returns: the new value
Returns: the old value
Returns: the new value
Returns: the new value