short wrapper.
This class was created before the introduction of the the java. package and the AtomicInteger class.
Note that as MutableShort does not extend Short, it is not treated by String.format as a Short parameter.
Short, AtomicInteger
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Required for serialization support.
|
| private short | value
The mutable value. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MutableShort(final Number
the initial value to store, not null. value)Constructs a new MutableShort with the specified value. |
| public | MutableShort(final short
the initial value to store. value)Constructs a new MutableShort with the specified value. |
| public | MutableShort(final String
the string to parse, not null. value)Constructs a new MutableShort parsing the given string. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public short | |
| public short | Returns: the value associated with this instance after adding the operand.the quantity to add, not null. operand)Increments this instance's value by |
| public int | Returns: negative if this is less, zero if equal, positive if greater.the other mutable to compare to, not null. other)Implements java. Compares this mutable to another in ascending order. |
| public void | |
| public short | Returns: the value associated with the instance after it is decremented.Decrements this instance's value by 1; this method returns the value associated with the instance immediately after the decrement operation. |
| public double | Returns: the numeric value represented by this object after conversion to type double.Implements abstract java. Returns the value of this MutableShort as a double. |
| public boolean | Returns: true if the objects are the same; false otherwise.the object to compare with, null returns false. obj)Overrides java. Compares this object to the specified object. |
| public float | Returns: the numeric value represented by this object after conversion to type float.Implements abstract java. Returns the value of this MutableShort as a float. |
| public short | |
| public short | Returns: the value associated with this instance immediately before the operand was added.the quantity to add, not null. operand)Increments this instance's value by |
| public short | Returns: the value associated with the instance before it was decremented.Decrements this instance's value by 1; this method returns the value associated with the instance immediately prior to the decrement operation. |
| public short | Returns: the value associated with the instance before it was incremented.Increments this instance's value by 1; this method returns the value associated with the instance immediately prior to the increment operation. |
| public Short | Returns: the value as a Short, never null.Implements org.
Deprecated
Use
get().
Gets the value as a Short instance. |
| public int | Returns: a suitable hash code.Overrides java. Returns a suitable hash code for this mutable. |
| public void | |
| public short | Returns: the value associated with the instance after it is incremented.Increments this instance's value by 1; this method returns the value associated with the instance immediately after the increment operation. |
| public int | Returns: the numeric value represented by this object after conversion to type int.Implements abstract java. Returns the value of this MutableShort as an int. |
| public long | Returns: the numeric value represented by this object after conversion to type long.Implements abstract java. Returns the value of this MutableShort as a long. |
| public void | setValue(final Number
the value to set, not null. value)Implements org. Sets the value from any Number instance. |
| public void | setValue(final short
the value to set value)Implements org. Sets the value. |
| public short | Returns: the numeric value represented by this object after conversion to type short.Overrides java. Returns the value of this MutableShort as a short. |
| public void | |
| public void | subtract(final short
the value to subtract, not null. operand)Subtracts a value from the value of this instance. |
| public Short | Returns: a Short instance containing the value from this mutable, never null.Gets this mutable as an instance of Short. |
| public String | Returns: the mutable value as a string.Overrides java. Returns the String value of this mutable. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Required for serialization support.
| |
| value | back to summary |
|---|---|
| private short value The mutable value. | |
| MutableShort | back to summary |
|---|---|
| public MutableShort() Constructs a new MutableShort with the default value of zero. | |
| MutableShort | back to summary |
|---|---|
| public MutableShort(final Number value) Constructs a new MutableShort with the specified value.
| |
| MutableShort | back to summary |
|---|---|
| public MutableShort(final short value) Constructs a new MutableShort with the specified value.
| |
| MutableShort | back to summary |
|---|---|
| public MutableShort(final String value) Constructs a new MutableShort parsing the given string.
| |
| add | back to summary |
|---|---|
| public void add(final Number operand) Adds a value to the value of this instance.
| |
| add | back to summary |
|---|---|
| public void add(final short operand) Adds a value to the value of this instance.
| |
| addAndGet | back to summary |
|---|---|
| public short addAndGet(final Number operand) Increments this instance's value by
| |
| addAndGet | back to summary |
|---|---|
| public short addAndGet(final short operand) Increments this instance's value by
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(final MutableShort other) Implements java. Compares this mutable to another in ascending order.
| |
| decrement | back to summary |
|---|---|
| public void decrement() Decrements the value.
| |
| decrementAndGet | back to summary |
|---|---|
| public short decrementAndGet() Decrements this instance's value by 1; this method returns the value associated with the instance immediately after the decrement operation. This method is not thread safe.
| |
| doubleValue | back to summary |
|---|---|
| public double doubleValue() Implements abstract java. Returns the value of this MutableShort as a double.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Compares this object to the specified object. The result is | |
| floatValue | back to summary |
|---|---|
| public float floatValue() Implements abstract java. Returns the value of this MutableShort as a float.
| |
| getAndAdd | back to summary |
|---|---|
| public short getAndAdd(final Number operand) Increments this instance's value by
| |
| getAndAdd | back to summary |
|---|---|
| public short getAndAdd(final short operand) Increments this instance's value by
| |
| getAndDecrement | back to summary |
|---|---|
| public short getAndDecrement() Decrements this instance's value by 1; this method returns the value associated with the instance immediately prior to the decrement operation. This method is not thread safe.
| |
| getAndIncrement | back to summary |
|---|---|
| public short getAndIncrement() Increments this instance's value by 1; this method returns the value associated with the instance immediately prior to the increment operation. This method is not thread safe.
| |
| getValue | back to summary |
|---|---|
| public Short getValue() Implements org. Deprecated Use Gets the value as a Short instance.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a suitable hash code for this mutable.
| |
| increment | back to summary |
|---|---|
| public void increment() Increments the value.
| |
| incrementAndGet | back to summary |
|---|---|
| public short incrementAndGet() Increments this instance's value by 1; this method returns the value associated with the instance immediately after the increment operation. This method is not thread safe.
| |
| intValue | back to summary |
|---|---|
| public int intValue() Implements abstract java. Returns the value of this MutableShort as an int.
| |
| longValue | back to summary |
|---|---|
| public long longValue() Implements abstract java. Returns the value of this MutableShort as a long.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final Number value) Implements org. Sets the value from any Number instance.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final short value) Implements org. Sets the value.
| |
| shortValue | back to summary |
|---|---|
| public short shortValue() Overrides java. Returns the value of this MutableShort as a short.
| |
| subtract | back to summary |
|---|---|
| public void subtract(final Number operand) Subtracts a value from the value of this instance.
| |
| subtract | back to summary |
|---|---|
| public void subtract(final short operand) Subtracts a value from the value of this instance.
| |
| toShort | back to summary |
|---|---|
| public Short toShort() Gets this mutable as an instance of Short.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the String value of this mutable. | |