Class IntUtil


  • public final class IntUtil
    extends Object

    The IntUtil class is a final class that provides static methods for working with integer int values.

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

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

    Since:
    1.0.0.f
    • Method Detail

      • isEven

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

        public static boolean isOdd​(int input)
        Check if the input is an odd number.
        Parameters:
        input - An int 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
      • toLongAsUnsigned

        public static long toLongAsUnsigned​(int input)
        Convert the integer int input as unsigned bits to an integer long value.
        Parameters:
        input - An int integer.
        Returns:
        An integer long value of the input's value as unsigned bits.
        Since:
        1.0.0.f
      • toSignedBinary

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

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

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

        public static String toStringAsUnsigned​(int input)
        Parse the integer int input to a string of decimal as unsigned bits.
        Parameters:
        input - An int integer.
        Returns:
        A string of decimal of the input's value as unsigned bits.
        Since:
        1.0.0.f