类 MutableShort

java.lang.Object
java.lang.Number
com.luna.common.mutable.MutableShort
所有已实现的接口:
Mutable<Number>, Serializable, Comparable<MutableShort>

public class MutableShort extends Number implements Comparable<MutableShort>, Mutable<Number>
可变 short 类型
从以下版本开始:
3.0.1
另请参阅:
  • 构造器详细资料

    • MutableShort

      public MutableShort()
      构造,默认值0
    • MutableShort

      public MutableShort(short value)
      构造
      参数:
      value - 值
    • MutableShort

      public MutableShort(Number value)
      构造
      参数:
      value - 值
    • MutableShort

      public MutableShort(String value) throws NumberFormatException
      构造
      参数:
      value - String值
      抛出:
      NumberFormatException - 转为Short错误
  • 方法详细资料

    • get

      public Short get()
      从接口复制的说明: Mutable
      获得原始值
      指定者:
      get 在接口中 Mutable<Number>
      返回:
      原始值
    • set

      public void set(short value)
      设置值
      参数:
      value - 值
    • set

      public void set(Number value)
      从接口复制的说明: Mutable
      设置值
      指定者:
      set 在接口中 Mutable<Number>
      参数:
      value - 值
    • increment

      public MutableShort increment()
      值+1
      返回:
      this
    • decrement

      public MutableShort decrement()
      值减一
      返回:
      this
    • add

      public MutableShort add(short operand)
      增加值
      参数:
      operand - 被增加的值
      返回:
      this
    • add

      public MutableShort add(Number operand)
      增加值
      参数:
      operand - 被增加的值,非空
      返回:
      this
      抛出:
      NullPointerException - if the object is null
    • subtract

      public MutableShort subtract(short operand)
      减去值
      参数:
      operand - 被减的值
      返回:
      this
    • subtract

      public MutableShort subtract(Number operand)
      减去值
      参数:
      operand - 被减的值,非空
      返回:
      this
      抛出:
      NullPointerException - if the object is null
    • shortValue

      public short shortValue()
      覆盖:
      shortValue 在类中 Number
    • intValue

      public int intValue()
      指定者:
      intValue 在类中 Number
    • longValue

      public long longValue()
      指定者:
      longValue 在类中 Number
    • floatValue

      public float floatValue()
      指定者:
      floatValue 在类中 Number
    • doubleValue

      public double doubleValue()
      指定者:
      doubleValue 在类中 Number
    • equals

      public boolean equals(Object obj)
      相等需同时满足如下条件:
      1. 非空
      2. 类型为 MutableShort
      3. 值相等
      覆盖:
      equals 在类中 Object
      参数:
      obj - 比对的对象
      返回:
      相同返回true,否则 false
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • compareTo

      public int compareTo(MutableShort other)
      比较
      指定者:
      compareTo 在接口中 Comparable<MutableShort>
      参数:
      other - 其它 MutableShort 对象
      返回:
      x==y返回0,x<y返回-1,x>y返回1
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object