Top Description Fields Constructors Methods
org.postgresql.util

public Class NumberParser

extends Object
Class Inheritance

Optimised byte[] to number parser.

Field Summary

Modifier and TypeField and Description
private static final NumberFormatException
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

The parsed number.
getFastLong
(byte[]
integer represented as a sequence of ASCII bytes
bytes
,
long minVal, long maxVal)

Optimised byte[] to number parser.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FAST_NUMBER_FAILEDback to summary
private static final NumberFormatException FAST_NUMBER_FAILED
MAX_LONG_DIV_TENback to summary
private static final long MAX_LONG_DIV_TEN

Constructor Detail

NumberParserback to summary
public NumberParser()

Method Detail

getFastLongback to summary
public static long getFastLong(byte[] bytes, long minVal, long maxVal) throws NumberFormatException

Optimised byte[] to number parser. This code does not handle null values, so the caller must do checkResultSet and handle null values prior to calling this function. Fraction part is discarded.

Parameters
bytes:byte[]

integer represented as a sequence of ASCII bytes

Returns:long

The parsed number.

Exceptions
NumberFormatException:
If the number is invalid or the out of range for fast parsing. The value must then be parsed by another (less optimised) method.