Top Description Fields Constructors Methods
ch.randelshofer.fastdoubleparser

public Class JavaBigIntegerParser

extends Object
Class Inheritance
Imports
java.math.BigInteger

Parses a BigInteger value; the supported syntax is compatible with BigInteger#BigInteger(String, int).

Syntax

Formal specification of the grammar:

BigIntegerLiteral:
[Sign] Digits
Sign:
(one of)
+ -
Digits:
Digit {Digit}
Digit:
(one of)
0 1 2 3 4 5 6 7 8 9
a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Character lengths accepted by BigInteger#BigInteger(String):

Maximal input length supported by this parser:

Field Summary

Modifier and TypeField and Description
private static final JavaBigIntegerFromByteArray
private static final JavaBigIntegerFromCharArray
private static final JavaBigIntegerFromCharSequence

Constructor Summary

AccessConstructor and Description
private
JavaBigIntegerParser()

Don't let anyone instantiate this class.

Method Summary

Modifier and TypeMethod and Description
public static BigInteger

Returns:

the parsed value
parseBigInteger
(CharSequence
the string to be parsed
str
)

Convenience method for calling parseBigInteger(CharSequence, int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(CharSequence
the string to be parsed
str
,
int
the radix to be used in interpreting the str
radix
)

Convenience method for calling parseBigInteger(CharSequence, int, int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(CharSequence
the string to be parsed
str
,
int
The index of the first character to parse
offset
,
int
The number of characters to parse
length
)

Convenience method for calling parseBigInteger(CharSequence, int, int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(CharSequence
the string to be parsed
str
,
int
The index of the first character to parse
offset
,
int
The number of characters to parse
length
,
int
the radix to be used in interpreting the str
radix
)

Parses a BigIntegerLiteral from a CharSequence and converts it into a BigInteger value.

public static BigInteger

Returns:

the parsed value
parseBigInteger
(byte[]
the string to be parsed
str
)

Convenience method for calling parseBigInteger(byte[], int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(byte[]
the string to be parsed
str
,
int
the radix to be used in interpreting the str
radix
)

Convenience method for calling parseBigInteger(byte[], int, int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(byte[]
the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding
str
,
int
The index of the first character to parse
offset
,
int
The number of characters to parse
length
)

Parses a BigIntegerLiteral from a byte-Array and converts it into a BigInteger value.

public static BigInteger

Returns:

the parsed value
parseBigInteger
(byte[]
the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding
str
,
int
The index of the first character to parse
offset
,
int
The number of characters to parse
length
,
int
the radix to be used in interpreting the str
radix
)

Parses a BigIntegerLiteral from a byte-Array and converts it into a BigInteger value.

public static BigInteger

Returns:

the parsed value
parseBigInteger
(char[]
the string to be parsed
str
)

Convenience method for calling parseBigInteger(char[], int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(char[]
the string to be parsed
str
,
int
the radix to be used in interpreting the str
radix
)

Convenience method for calling parseBigInteger(char[], int, int, int).

public static BigInteger

Returns:

the parsed value
parseBigInteger
(char[]
the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding
str
,
int
The index of the first character to parse
offset
,
int
The number of characters to parse
length
)

Parses a BigIntegerLiteral from a char-Array and converts it into a BigInteger value.

public static BigInteger

Returns:

the parsed value
parseBigInteger
(char[]
the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding
str
,
int
The index of the first character to parse
offset
,
int
The number of characters to parse
length
,
int
the radix to be used in interpreting the str
radix
)

Parses a BigIntegerLiteral from a char-Array and converts it into a BigInteger value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BYTE_ARRAY_PARSERback to summary
private static final JavaBigIntegerFromByteArray BYTE_ARRAY_PARSER
CHAR_ARRAY_PARSERback to summary
private static final JavaBigIntegerFromCharArray CHAR_ARRAY_PARSER
CHAR_SEQUENCE_PARSERback to summary
private static final JavaBigIntegerFromCharSequence CHAR_SEQUENCE_PARSER

Constructor Detail

JavaBigIntegerParserback to summary
private JavaBigIntegerParser()

Don't let anyone instantiate this class.

Method Detail

parseBigIntegerback to summary
public static BigInteger parseBigInteger(CharSequence str)

Convenience method for calling parseBigInteger(CharSequence, int, int).

Parameters
str:CharSequence

the string to be parsed

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(CharSequence str, int radix)

Convenience method for calling parseBigInteger(CharSequence, int, int, int).

Parameters
str:CharSequence

the string to be parsed

radix:int

the radix to be used in interpreting the str

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(CharSequence str, int offset, int length)

Convenience method for calling parseBigInteger(CharSequence, int, int, int).

Parameters
str:CharSequence

the string to be parsed

offset:int

The index of the first character to parse

length:int

The number of characters to parse

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
IllegalArgumentException:
if offset or length are illegal
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(CharSequence str, int offset, int length, int radix)

Parses a BigIntegerLiteral from a CharSequence and converts it into a BigInteger value.

Parameters
str:CharSequence

the string to be parsed

offset:int

The index of the first character to parse

length:int

The number of characters to parse

radix:int

the radix to be used in interpreting the str

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
IllegalArgumentException:
if offset or length are illegal
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(byte[] str)

Convenience method for calling parseBigInteger(byte[], int, int).

Parameters
str:byte[]

the string to be parsed

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(byte[] str, int radix)

Convenience method for calling parseBigInteger(byte[], int, int, int).

Parameters
str:byte[]

the string to be parsed

radix:int

the radix to be used in interpreting the str

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(byte[] str, int offset, int length)

Parses a BigIntegerLiteral from a byte-Array and converts it into a BigInteger value.

See JsonDoubleParser for the syntax of FloatingPointLiteral.

Parameters
str:byte[]

the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding

offset:int

The index of the first character to parse

length:int

The number of characters to parse

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
IllegalArgumentException:
if offset or length are illegal
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(byte[] str, int offset, int length, int radix)

Parses a BigIntegerLiteral from a byte-Array and converts it into a BigInteger value.

See JsonDoubleParser for the syntax of FloatingPointLiteral.

Parameters
str:byte[]

the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding

offset:int

The index of the first character to parse

length:int

The number of characters to parse

radix:int

the radix to be used in interpreting the str

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
IllegalArgumentException:
if offset or length are illegal
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(char[] str)

Convenience method for calling parseBigInteger(char[], int, int).

Parameters
str:char[]

the string to be parsed

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(char[] str, int radix)

Convenience method for calling parseBigInteger(char[], int, int, int).

Parameters
str:char[]

the string to be parsed

radix:int

the radix to be used in interpreting the str

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(char[] str, int offset, int length)

Parses a BigIntegerLiteral from a char-Array and converts it into a BigInteger value.

See JsonDoubleParser for the syntax of FloatingPointLiteral.

Parameters
str:char[]

the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding

offset:int

The index of the first character to parse

length:int

The number of characters to parse

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
IllegalArgumentException:
if offset or length are illegal
NumberFormatException:
if the string can not be parsed successfully
parseBigIntegerback to summary
public static BigInteger parseBigInteger(char[] str, int offset, int length, int radix)

Parses a BigIntegerLiteral from a char-Array and converts it into a BigInteger value.

See JsonDoubleParser for the syntax of FloatingPointLiteral.

Parameters
str:char[]

the string to be parsed, a byte array with characters in ISO-8859-1, ASCII or UTF-8 encoding

offset:int

The index of the first character to parse

length:int

The number of characters to parse

radix:int

the radix to be used in interpreting the str

Returns:BigInteger

the parsed value

Exceptions
NullPointerException:
if the string is null
IllegalArgumentException:
if offset or length are illegal
NumberFormatException:
if the string can not be parsed successfully