类 MutableByte

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

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

    • MutableByte

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

      public MutableByte(byte value)
      构造
      参数:
      value - 值
    • MutableByte

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

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

    • get

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

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

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

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

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

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

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

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

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

      public byte byteValue()
      覆盖:
      byteValue 在类中 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. 类型为 MutableByte
      3. 值相等
      覆盖:
      equals 在类中 Object
      参数:
      obj - 比对的对象
      返回:
      相同返回true,否则 false
    • hashCode

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

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

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