Package host.fai.lib.faiNumber
Class IntUtil
- java.lang.Object
-
- host.fai.lib.faiNumber.IntUtil
-
public final class IntUtil extends Object
The
IntUtilclass 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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisEven(int input)Check if the input is an even number.static booleanisOdd(int input)Check if the input is an odd number.static longtoLongAsUnsigned(int input)Convert the integer intinputas unsigned bits to an integer long value.static StringtoSignedBinary(int input)Parse the integer intinputto a string of signed binary digits.static StringtoSignedHex(int input)Parse the integer intinputto a string of signed hexadecimal digits.static StringtoSignedOctal(int input)Parse the integer intinputto a string of signed octal digits.static StringtoStringAsUnsigned(int input)Parse the integer intinputto a string of decimal as unsigned bits.
-
-
-
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 intinputas 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 intinputto 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 intinputto 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 intinputto 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 intinputto 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
-
-