Package host.fai.lib.faiNumber
Class LongUtil
- java.lang.Object
-
- host.fai.lib.faiNumber.LongUtil
-
public final class LongUtil extends Object
The
LongUtilclass 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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisEven(long input)Check if the input is an even number.static booleanisOdd(long input)Check if the input is an odd number.static StringtoSignedBinary(long input)Parse the integer longinputto a string of signed binary digits.static StringtoSignedHex(long input)Parse the integer longinputto a string of signed hexadecimal digits.static StringtoSignedOctal(long input)Parse the integer longinputto a string of signed octal digits.static StringtoStringAsUnsigned(long input)Parse the integer longinputto a string of decimal as unsigned bits.
-
-
-
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
inputis an odd number or false if it is not. - Since:
- 1.0.0.f
-
toSignedBinary
public static String toSignedBinary(long input)
Parse the integer longinputto 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 longinputto 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 longinputto 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 longinputto 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
-
-