| java.lang.Object EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable EDU.oswego.cs.dl.util.concurrent.SynchronizedChar
All known Subclasses: EDU.oswego.cs.dl.util.concurrent.WaitableChar,
Field Summary | |
protected char | value_ |
Constructor Summary | |
public | SynchronizedChar(char initialValue) Make a new SynchronizedChar with the given initial value,
and using its own internal lock. | public | SynchronizedChar(char initialValue, Object lock) Make a new SynchronizedChar with the given initial value,
and using the supplied lock. |
value_ | protected char value_(Code) | | |
SynchronizedChar | public SynchronizedChar(char initialValue)(Code) | | Make a new SynchronizedChar with the given initial value,
and using its own internal lock.
|
SynchronizedChar | public SynchronizedChar(char initialValue, Object lock)(Code) | | Make a new SynchronizedChar with the given initial value,
and using the supplied lock.
|
add | public char add(char amount)(Code) | | Add amount to value (i.e., set value += amount)
the new value |
commit | public boolean commit(char assumedValue, char newValue)(Code) | | Set value to newValue only if it is currently assumedValue.
true if successful |
compareTo | public int compareTo(char other)(Code) | | |
divide | public char divide(char factor)(Code) | | Divide value by factor (i.e., set value /= factor)
the new value |
get | final public char get()(Code) | | Return the current value
|
hashCode | public int hashCode()(Code) | | |
multiply | public synchronized char multiply(char factor)(Code) | | Multiply value by factor (i.e., set value *= factor)
the new value |
set | public char set(char newValue)(Code) | | Set to newValue.
the old value |
subtract | public char subtract(char amount)(Code) | | Subtract amount from value (i.e., set value -= amount)
the new value |
swap | public char swap(SynchronizedChar other)(Code) | | Atomically swap values with another SynchronizedChar.
Uses identityHashCode to avoid deadlock when
two SynchronizedChars attempt to simultaneously swap with each other.
(Note: Ordering via identyHashCode is not strictly guaranteed
by the language specification to return unique, orderable
values, but in practice JVMs rely on them being unique.)
the new value |
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SynchronizedVariable | final protected Object lock_(Code)(Java Doc)
|
|
|