Class Unsigned


  • public final class Unsigned
    extends java.lang.Object
    A utility class for static access to unsigned number functionality.

    It essentially contains factory methods for unsigned number wrappers. In future versions, it will also contain some arithmetic methods, handling regular arithmetic and bitwise operations

    Author:
    Lukas Eder
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static UByte ubyte​(byte value)
      Create an unsigned byte by masking it with 0xFF i.e.
      static UByte ubyte​(int value)
      Create an unsigned byte
      static UByte ubyte​(long value)
      Create an unsigned byte
      static UByte ubyte​(short value)
      Create an unsigned byte
      static UByte ubyte​(java.lang.String value)
      Create an unsigned byte
      static UInteger uint​(int value)
      Create an unsigned int by masking it with 0xFFFFFFFF i.e.
      static UInteger uint​(long value)
      Create an unsigned int
      static UInteger uint​(java.lang.String value)
      Create an unsigned int
      static ULong ulong​(long value)
      Create an unsigned long by masking it with 0xFFFFFFFFFFFFFFFF i.e.
      static ULong ulong​(java.lang.String value)
      Create an unsigned long
      static ULong ulong​(java.math.BigInteger value)
      Create an unsigned long
      static UShort ushort​(int value)
      Create an unsigned short
      static UShort ushort​(short value)
      Create an unsigned short by masking it with 0xFFFF i.e.
      static UShort ushort​(java.lang.String value)
      Create an unsigned short
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ubyte

        public static UByte ubyte​(java.lang.String value)
                           throws java.lang.NumberFormatException
        Create an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value does not contain a parsable unsigned byte.
        See Also:
        UByte.valueOf(String)
      • ubyte

        public static UByte ubyte​(byte value)
        Create an unsigned byte by masking it with 0xFF i.e. (byte) -1 becomes (ubyte) 255
        See Also:
        UByte.valueOf(byte)
      • ubyte

        public static UByte ubyte​(short value)
                           throws java.lang.NumberFormatException
        Create an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned byte
        See Also:
        UByte.valueOf(short)
      • ubyte

        public static UByte ubyte​(int value)
                           throws java.lang.NumberFormatException
        Create an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned byte
        See Also:
        UByte.valueOf(short)
      • ubyte

        public static UByte ubyte​(long value)
                           throws java.lang.NumberFormatException
        Create an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned byte
        See Also:
        UByte.valueOf(short)
      • ushort

        public static UShort ushort​(java.lang.String value)
                             throws java.lang.NumberFormatException
        Create an unsigned short
        Throws:
        java.lang.NumberFormatException - If value does not contain a parsable unsigned short.
        See Also:
        UShort.valueOf(String)
      • ushort

        public static UShort ushort​(short value)
        Create an unsigned short by masking it with 0xFFFF i.e. (short) -1 becomes (ushort) 65535
        See Also:
        UShort.valueOf(short)
      • ushort

        public static UShort ushort​(int value)
                             throws java.lang.NumberFormatException
        Create an unsigned short
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned short
        See Also:
        UShort.valueOf(int)
      • uint

        public static UInteger uint​(java.lang.String value)
                             throws java.lang.NumberFormatException
        Create an unsigned int
        Throws:
        java.lang.NumberFormatException - If value does not contain a parsable unsigned int.
        See Also:
        UInteger.valueOf(String)
      • uint

        public static UInteger uint​(int value)
        Create an unsigned int by masking it with 0xFFFFFFFF i.e. (int) -1 becomes (uint) 4294967295
        See Also:
        UInteger.valueOf(int)
      • uint

        public static UInteger uint​(long value)
                             throws java.lang.NumberFormatException
        Create an unsigned int
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned int
        See Also:
        UInteger.valueOf(long)
      • ulong

        public static ULong ulong​(java.lang.String value)
                           throws java.lang.NumberFormatException
        Create an unsigned long
        Throws:
        java.lang.NumberFormatException - If value does not contain a parsable unsigned long.
        See Also:
        ULong.valueOf(String)
      • ulong

        public static ULong ulong​(long value)
        Create an unsigned long by masking it with 0xFFFFFFFFFFFFFFFF i.e. (long) -1 becomes (uint) 18446744073709551615
        See Also:
        ULong.valueOf(long)
      • ulong

        public static ULong ulong​(java.math.BigInteger value)
                           throws java.lang.NumberFormatException
        Create an unsigned long
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned long
        See Also:
        ULong.valueOf(BigInteger)