Class LongUtil


  • public final class LongUtil
    extends Object

    The LongUtil class is a final class that provides methods for working with integer long values.

    This class provides methods for parsing integer long values to signed hexadecimal or signed octal digits in string representation.

    This class supports parsing long values as unsigned long to string of decimal digits.

    Since:
    1.0.0.f
    • Method Detail

      • isEven

        public static boolean isEven​(long input)
        Check if the input is an even number.
        Parameters:
        input - A long integer.
        Returns:
        A boolean value of true if the input is an even number or false if it is not.
        Since:
        1.0.0.f
      • isOdd

        public static boolean isOdd​(long input)
        Check if the input is an odd number.
        Parameters:
        input - A long integer.
        Returns:
        A boolean value of true if the input is an odd number or false if it is not.
        Since:
        1.0.0.f
      • toSignedBinary

        public static String toSignedBinary​(long input)
        Parse the integer long input to a string of signed binary digits.
        Parameters:
        input - A long integer.
        Returns:
        A string of signed binary digits of the input's value.
        Since:
        1.0.0.f
      • toSignedHex

        public static String toSignedHex​(long input)
        Parse the integer long input to a string of signed hexadecimal digits.
        Parameters:
        input - A long integer.
        Returns:
        A string of signed hexadecimal digits of the input's value.
        Since:
        1.0.0.f
      • toSignedOctal

        public static String toSignedOctal​(long input)
        Parse the integer long input to a string of signed octal digits.
        Parameters:
        input - A long integer.
        Returns:
        A string of signed octal digits of the input's value.
        Since:
        1.0.0.f
      • toStringAsUnsigned

        public static String toStringAsUnsigned​(long input)
        Parse the integer long input to a string of decimal as unsigned bits. Take note that this method is a bit slow currently.
        Parameters:
        input - A long integer.
        Returns:
        A string of decimal of the input's value as unsigned bits.
        Since:
        1.0.0.f