Class Numbers
java.lang.Object
org.codehaus.commons.compiler.util.Numbers
Utility methods related to
Number
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]
private static final long[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
parseUnsignedInt
(String s, int radix) Counterpart ofInteger.parseInt(String, int)
for parsing unsigned integers.static long
parseUnsignedLong
(String s, int radix) Counterpart ofLong.parseLong(String, int)
for parsing unsigned integers.
-
Field Details
-
INT_LIMITS
private static final int[] INT_LIMITS -
LONG_LIMITS
private static final long[] LONG_LIMITS
-
-
Constructor Details
-
Numbers
private Numbers()
-
-
Method Details
-
parseUnsignedInt
Counterpart ofInteger.parseInt(String, int)
for parsing unsigned integers.Redundant with
java.lang.Integer.parseUnsignedInt(String, int radix)
, which is available since Java 8.- Returns:
- 0 through 232 - 1
- Throws:
NumberFormatException
- s isnull
or emptyNumberFormatException
- radix is out of range (seeCharacter.digit(char, int)
)NumberFormatException
- The value represented by s is larger than 232 - 1NumberFormatException
- s contains characters that are not valid digits for the given radix (seeCharacter.digit(char, int)
)
-
parseUnsignedLong
Counterpart ofLong.parseLong(String, int)
for parsing unsigned integers.Redundant with
java.lang.Long.parseUnsignedLong(String, int radix)
, which is available since Java 8.- Returns:
- 0 through 264 - 1
- Throws:
NumberFormatException
- s isnull
or emptyNumberFormatException
- radix is out of range (seeCharacter.digit(char, int)
)NumberFormatException
- The value represented by s is larger than 264 - 1NumberFormatException
- s contains characters that are not valid digits for the given radix (seeCharacter.digit(char, int)
)
-