public final class

NumberInput

extends Object
java.lang.Object
   ↳ com.fasterxml.jackson.core.io.NumberInput

Summary

Constants
String NASTY_SMALL_DOUBLE Textual representation of a double constant that can cause nasty problems with JDK (see http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308).
Public Constructors
NumberInput()
Public Methods
final static boolean inLongRange(char[] digitChars, int offset, int len, boolean negative)
Helper method for determining if given String representation of an integral number would fit in 64-bit Java long or not.
final static boolean inLongRange(String numberStr, boolean negative)
Similar to inLongRange(char[], int, int, boolean), but with String argument
static double parseAsDouble(String input, double defaultValue)
static int parseAsInt(String input, int defaultValue)
static long parseAsLong(String input, long defaultValue)
final static double parseDouble(String numStr)
final static int parseInt(String str)
Helper method to (more) efficiently parse integer numbers from String values.
final static int parseInt(char[] digitChars, int offset, int len)
Fast method for parsing integers that are known to fit into regular 32-bit signed int type.
final static long parseLong(String str)
final static long parseLong(char[] digitChars, int offset, int len)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String NASTY_SMALL_DOUBLE

Textual representation of a double constant that can cause nasty problems with JDK (see http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308).

Constant Value: "2.2250738585072012e-308"

Public Constructors

public NumberInput ()

Public Methods

public static final boolean inLongRange (char[] digitChars, int offset, int len, boolean negative)

Helper method for determining if given String representation of an integral number would fit in 64-bit Java long or not. Note that input String must NOT contain leading minus sign (even if 'negative' is set to true).

Parameters
negative Whether original number had a minus sign (which is NOT passed to this method) or not

public static final boolean inLongRange (String numberStr, boolean negative)

Similar to inLongRange(char[], int, int, boolean), but with String argument

Parameters
negative Whether original number had a minus sign (which is NOT passed to this method) or not

public static double parseAsDouble (String input, double defaultValue)

public static int parseAsInt (String input, int defaultValue)

public static long parseAsLong (String input, long defaultValue)

public static final double parseDouble (String numStr)

public static final int parseInt (String str)

Helper method to (more) efficiently parse integer numbers from String values.

public static final int parseInt (char[] digitChars, int offset, int len)

Fast method for parsing integers that are known to fit into regular 32-bit signed int type. This means that length is between 1 and 9 digits (inclusive)

Note: public to let unit tests call it

public static final long parseLong (String str)

public static final long parseLong (char[] digitChars, int offset, int len)