Introduction to this package.
| Modifier and Type | Field and Description |
|---|---|
| protected short |
| Access | Constructor and Description |
|---|---|
| public | SynchronizedShort(short initialValue)
Make a new SynchronizedShort with the given initial value, and using its own internal lock. |
| public | SynchronizedShort(short initialValue, Object lock)
Make a new SynchronizedShort with the given initial value, and using the supplied lock. |
| Modifier and Type | Method and Description |
|---|---|
| public short | |
| public short | |
| public boolean | Returns: true if successfulSet value to newValue only if it is currently assumedValue. |
| public int | compareTo(short
the object to be compared. other)Implements java. |
| public int | compareTo(SynchronizedShort
the object to be compared. other)Implements java. |
| public int | compareTo(Object
the object to be compared. other)Implements java. |
| public short | |
| public short | |
| public short | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public final short | |
| public int | |
| public short | |
| public short | |
| public short | |
| public short | |
| public short | |
| public short | |
| public short | Returns: the new valueAtomically swap values with another SynchronizedShort. |
| public String | |
| public short |
| value_ | back to summary |
|---|---|
| protected short value_ | |
| SynchronizedShort | back to summary |
|---|---|
| public SynchronizedShort(short initialValue) Make a new SynchronizedShort with the given initial value, and using its own internal lock. | |
| SynchronizedShort | back to summary |
|---|---|
| public SynchronizedShort(short initialValue, Object lock) Make a new SynchronizedShort with the given initial value, and using the supplied lock. | |
| add | back to summary |
|---|---|
| public short add(short amount) Add amount to value (i.e., set value += amount)
| |
| and | back to summary |
|---|---|
| public short and(short b) Set value to value & b.
| |
| commit | back to summary |
|---|---|
| public boolean commit(short assumedValue, short newValue) Set value to newValue only if it is currently assumedValue.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(short other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(SynchronizedShort other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| complement | back to summary |
|---|---|
| public short complement() Set the value to its complement
| |
| decrement | back to summary |
|---|---|
| public short decrement() Decrement the value.
| |
| divide | back to summary |
|---|---|
| public short divide(short factor) Divide value by factor (i.e., set value /= factor)
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| get | back to summary |
|---|---|
| public final short get() Return the current value | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| increment | back to summary |
|---|---|
| public short increment() Increment the value.
| |
| multiply | back to summary |
|---|---|
| public short multiply(short factor) Multiply value by factor (i.e., set value *= factor)
| |
| negate | back to summary |
|---|---|
| public short negate() Set the value to the negative of its old value
| |
| or | back to summary |
|---|---|
| public short or(short b) Set value to value | b.
| |
| set | back to summary |
|---|---|
| public short set(short newValue) Set to newValue.
| |
| subtract | back to summary |
|---|---|
| public short subtract(short amount) Subtract amount from value (i.e., set value -= amount)
| |
| swap | back to summary |
|---|---|
| public short swap(SynchronizedShort other) Atomically swap values with another SynchronizedShort. Uses identityHashCode to avoid deadlock when two SynchronizedShorts 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.)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| xor | back to summary |
|---|---|
| public short xor(short b) Set value to value ^ b.
| |