Top Fields Constructors Methods
ch.randelshofer.fastdoubleparser

pack-priv abstract Class AbstractNumberParser

extends Object
Class Inheritance
Known Direct Subclasses
ch.randelshofer.fastdoubleparser.JavaBigDecimalFromByteArray, ch.randelshofer.fastdoubleparser.JavaBigDecimalFromCharArray, ch.randelshofer.fastdoubleparser.JavaBigDecimalFromCharSequence, ch.randelshofer.fastdoubleparser.JavaBigIntegerFromByteArray, ch.randelshofer.fastdoubleparser.JavaBigIntegerFromCharArray, ch.randelshofer.fastdoubleparser.JavaBigIntegerFromCharSequence, ch.randelshofer.fastdoubleparser.AbstractFloatValueParser
Imports
java.util.Arrays

Field Summary

Modifier and TypeField and Description
pack-priv static final byte[]
CHAR_TO_HEX_MAP

Includes all non-negative values of a byte, so that we only have to check for byte values < 0 before accessing this array.

pack-priv static final byte
DECIMAL_POINT_CLASS

Special value in CHAR_TO_HEX_MAP for the decimal point character.

public static final String
ILLEGAL_OFFSET_OR_ILLEGAL_LENGTH

Message text for the IllegalArgumentException that is thrown when offset or length are illegal

pack-priv static final byte
OTHER_CLASS

Special value in CHAR_TO_HEX_MAP for characters that are neither a hex digit nor a decimal point character..

public static final String
SYNTAX_ERROR

Message text for the NumberFormatException that is thrown when the syntax is illegal.

public static final String
VALUE_EXCEEDS_LIMITS

Message text for the NumberFormatException that is thrown when there are too many input digits.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected static byte

Returns:

the character or 0
charAt
(byte[]
the string
str
,
int
the index
i
,
int
the end index
endIndex
)

Returns the character at the specified index if index is < endIndex; otherwise returns 0.

protected static char

Returns:

the character or 0
charAt
(char[]
the string
str
,
int
the index
i
,
int
the end index
endIndex
)

Returns the character at the specified index if index is < endIndex; otherwise returns 0.

protected static char

Returns:

the character or 0
charAt
(CharSequence
the string
str
,
int
the index
i
,
int
the end index
endIndex
)

Returns the character at the specified index if index is < endIndex; otherwise returns 0.

protected static int

Returns:

the hex value or a value < 0.
lookupHex
(byte
a character
ch
)

Looks the character up in the CHAR_TO_HEX_MAP returns a value < 0 if the character is not in the map.

protected static int

Returns:

the hex value or a value < 0.
lookupHex
(char
a character
ch
)

Looks the character up in the CHAR_TO_HEX_MAP returns a value < 0 if the character is not in the map.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHAR_TO_HEX_MAPback to summary
pack-priv static final byte[] CHAR_TO_HEX_MAP

Includes all non-negative values of a byte, so that we only have to check for byte values < 0 before accessing this array.

DECIMAL_POINT_CLASSback to summary
pack-priv static final byte DECIMAL_POINT_CLASS

Special value in CHAR_TO_HEX_MAP for the decimal point character.

ILLEGAL_OFFSET_OR_ILLEGAL_LENGTHback to summary
public static final String ILLEGAL_OFFSET_OR_ILLEGAL_LENGTH

Message text for the IllegalArgumentException that is thrown when offset or length are illegal

OTHER_CLASSback to summary
pack-priv static final byte OTHER_CLASS

Special value in CHAR_TO_HEX_MAP for characters that are neither a hex digit nor a decimal point character..

SYNTAX_ERRORback to summary
public static final String SYNTAX_ERROR

Message text for the NumberFormatException that is thrown when the syntax is illegal.

VALUE_EXCEEDS_LIMITSback to summary
public static final String VALUE_EXCEEDS_LIMITS

Message text for the NumberFormatException that is thrown when there are too many input digits.

Constructor Detail

AbstractNumberParserback to summary
pack-priv AbstractNumberParser()

Method Detail

charAtback to summary
protected static byte charAt(byte[] str, int i, int endIndex)

Returns the character at the specified index if index is < endIndex; otherwise returns 0.

Parameters
str:byte[]

the string

i:int

the index

endIndex:int

the end index

Returns:byte

the character or 0

charAtback to summary
protected static char charAt(char[] str, int i, int endIndex)

Returns the character at the specified index if index is < endIndex; otherwise returns 0.

Parameters
str:char[]

the string

i:int

the index

endIndex:int

the end index

Returns:char

the character or 0

charAtback to summary
protected static char charAt(CharSequence str, int i, int endIndex)

Returns the character at the specified index if index is < endIndex; otherwise returns 0.

Parameters
str:CharSequence

the string

i:int

the index

endIndex:int

the end index

Returns:char

the character or 0

lookupHexback to summary
protected static int lookupHex(byte ch)

Looks the character up in the CHAR_TO_HEX_MAP returns a value < 0 if the character is not in the map.

Returns -4 if the character is a decimal point.

Parameters
ch:byte

a character

Returns:int

the hex value or a value < 0.

lookupHexback to summary
protected static int lookupHex(char ch)

Looks the character up in the CHAR_TO_HEX_MAP returns a value < 0 if the character is not in the map.

Returns -4 if the character is a decimal point.

Parameters
ch:char

a character

Returns:int

the hex value or a value < 0.