Class MutableByte

    • Constructor Detail

      • MutableByte

        public MutableByte​(int nValue)
        Initialize with a certain int value. If the value does not fit into a byte, the value is cut!
        Parameters:
        nValue - The value to be used.
      • MutableByte

        public MutableByte​(@Nonnull
                           Number aValue)
        Initialize with a certain value.
        Parameters:
        aValue - The value to be used.
      • MutableByte

        public MutableByte​(byte nValue)
        Initialize with a certain value.
        Parameters:
        nValue - The value to be used.
    • Method Detail

      • byteValue

        public byte byteValue()
        Description copied from interface: INumber
        Returns the value of the specified number as a byte, which may involve rounding or truncation.

        This implementation returns the result of INumber.intValue() cast to a byte.

        Specified by:
        byteValue in interface INumber
        Overrides:
        byteValue in class Number
        Returns:
        the numeric value represented by this object after conversion to type byte.
      • floatValue

        public float floatValue()
        Description copied from interface: INumber
        Returns the value of the specified number as a float, which may involve rounding.
        Specified by:
        floatValue in interface INumber
        Specified by:
        floatValue in class Number
        Returns:
        the numeric value represented by this object after conversion to type float.
      • doubleValue

        public double doubleValue()
        Description copied from interface: INumber
        Returns the value of the specified number as a double, which may involve rounding.
        Specified by:
        doubleValue in interface INumber
        Specified by:
        doubleValue in class Number
        Returns:
        the numeric value represented by this object after conversion to type double.
      • intValue

        public int intValue()
        Description copied from interface: INumber
        Returns the value of the specified number as an int, which may involve rounding or truncation.
        Specified by:
        intValue in interface INumber
        Specified by:
        intValue in class Number
        Returns:
        the numeric value represented by this object after conversion to type int.
      • longValue

        public long longValue()
        Description copied from interface: INumber
        Returns the value of the specified number as a long, which may involve rounding or truncation.
        Specified by:
        longValue in interface INumber
        Specified by:
        longValue in class Number
        Returns:
        the numeric value represented by this object after conversion to type long.
      • inc

        public int inc()
        Increment by 1 and return the modified value.
        Returns:
        The by 1 incremented value.
      • inc

        public int inc​(int nDelta)
      • dec

        public int dec()
      • dec

        public int dec​(int nDelta)
      • is0

        public boolean is0()
        Returns:
        true if the value is 0
      • isLT0

        public boolean isLT0()
        Returns:
        true if the value is < 0
      • isLE0

        public boolean isLE0()
        Returns:
        true if the value is ≤ 0
      • isGT0

        public boolean isGT0()
        Returns:
        true if the value is > 0
      • isGE0

        public boolean isGE0()
        Returns:
        true if the value is ≥ 0
      • isEven

        public boolean isEven()
        Returns:
        true if the value is even
      • getAndInc

        public byte getAndInc()
      • incAndGet

        public byte incAndGet()
      • getClone

        @Nonnull
        public MutableByte getClone()
        Returns:
        A 100% deep-copy of the implementing class.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object