Top Fields Constructors Methods
tools.jackson.core.io

public final Class NumberOutput

extends Object
Class Inheritance
Imports
tools.jackson.core.io.schubfach.DoubleToDecimal, .FloatToDecimal

Field Summary

Modifier and TypeField and Description
private static int
private static long
private static long
private static int
private static long
pack-priv static final String
pack-priv static final String
private static final int[]
TRIPLET_TO_CHARS

Encoded representations of 3-decimal-digit indexed values, where 3 LSB are ascii characters

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
_full3(int t, char[] b, int off)

private static int
_full3(int t, byte[] b, int off)

private static int
_leading3(int t, char[] b, int off)

private static int
_leading3(int t, byte[] b, int off)

private static int
_outputFullBillion(int v, char[] b, int off)

private static int
_outputFullBillion(int v, byte[] b, int off)

private static int
_outputSmallestI(char[] b, int off)

private static int
_outputSmallestI(byte[] b, int off)

private static int
_outputSmallestL(char[] b, int off)

private static int
_outputSmallestL(byte[] b, int off)

private static int
_outputUptoBillion(int v, char[] b, int off)

private static int
_outputUptoBillion(int v, byte[] b, int off)

private static int
_outputUptoMillion(char[] b, int off, int thousands, int ones)

private static int
_outputUptoMillion(byte[] b, int off, int thousands, int ones)

public static int
divBy1000(int number)

Optimized code for integer division by 1000; typically 50% higher throughput for calculation

public static boolean

Returns:

True if number is NOT finite (is Infinity or NaN); false otherwise
notFinite
(double
double value to check
value
)

Helper method to verify whether given double value is finite (regular rational number} or not (NaN or Infinity).

public static boolean

Returns:

True if number is NOT finite (is Infinity or NaN); false otherwise
notFinite
(float
float value to check
value
)

Helper method to verify whether given float value is finite (regular rational number} or not (NaN or Infinity).

public static int

Returns:

Offset within buffer after outputting int
outputInt
(int
Value to append to buffer
v
,
char[]
Buffer to append value to: caller must guarantee there is enough room
b
,
int
Offset within output buffer (b) to append number at
off
)

Method for appending value of given int value into specified char[].

public static int
outputInt(int v, byte[] b, int off)

public static int

Returns:

Offset within buffer after outputting long
outputLong
(long
Value to append to buffer
v
,
char[]
Buffer to append value to: caller must guarantee there is enough room
b
,
int
Offset within output buffer (b) to append number at
off
)

Method for appending value of given long value into specified char[].

public static int
outputLong(long v, byte[] b, int off)

public static String

Returns:

double as a string
toString
(final double
double
v
)

public static String

Returns:

double as a string
toString
(final double
double
v
,
final boolean
whether to use Schubfach algorithm to write output (default false)
useFastWriter
)

public static String

Returns:

float as a string
toString
(final float
float
v
)

public static String

Returns:

float as a string
toString
(final float
float
v
,
final boolean
whether to use Schubfach algorithm to write output (default false)
useFastWriter
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BILLIONback to summary
private static int BILLION
BILLION_Lback to summary
private static long BILLION_L
MAX_INT_AS_LONGback to summary
private static long MAX_INT_AS_LONG
MILLIONback to summary
private static int MILLION
MIN_INT_AS_LONGback to summary
private static long MIN_INT_AS_LONG
SMALLEST_INTback to summary
pack-priv static final String SMALLEST_INT
SMALLEST_LONGback to summary
pack-priv static final String SMALLEST_LONG
TRIPLET_TO_CHARSback to summary
private static final int[] TRIPLET_TO_CHARS

Encoded representations of 3-decimal-digit indexed values, where 3 LSB are ascii characters

Constructor Detail

NumberOutputback to summary
public NumberOutput()

Method Detail

_full3back to summary
private static int _full3(int t, char[] b, int off)
_full3back to summary
private static int _full3(int t, byte[] b, int off)
_leading3back to summary
private static int _leading3(int t, char[] b, int off)
_leading3back to summary
private static int _leading3(int t, byte[] b, int off)
_outputFullBillionback to summary
private static int _outputFullBillion(int v, char[] b, int off)
_outputFullBillionback to summary
private static int _outputFullBillion(int v, byte[] b, int off)
_outputSmallestIback to summary
private static int _outputSmallestI(char[] b, int off)
_outputSmallestIback to summary
private static int _outputSmallestI(byte[] b, int off)
_outputSmallestLback to summary
private static int _outputSmallestL(char[] b, int off)
_outputSmallestLback to summary
private static int _outputSmallestL(byte[] b, int off)
_outputUptoBillionback to summary
private static int _outputUptoBillion(int v, char[] b, int off)
_outputUptoBillionback to summary
private static int _outputUptoBillion(int v, byte[] b, int off)
_outputUptoMillionback to summary
private static int _outputUptoMillion(char[] b, int off, int thousands, int ones)
_outputUptoMillionback to summary
private static int _outputUptoMillion(byte[] b, int off, int thousands, int ones)
divBy1000back to summary
public static int divBy1000(int number)

Optimized code for integer division by 1000; typically 50% higher throughput for calculation

Since
2.17
notFiniteback to summary
public static boolean notFinite(double value)

Helper method to verify whether given double value is finite (regular rational number} or not (NaN or Infinity).

Parameters
value:double

double value to check

Returns:boolean

True if number is NOT finite (is Infinity or NaN); false otherwise

notFiniteback to summary
public static boolean notFinite(float value)

Helper method to verify whether given float value is finite (regular rational number} or not (NaN or Infinity).

Parameters
value:float

float value to check

Returns:boolean

True if number is NOT finite (is Infinity or NaN); false otherwise

outputIntback to summary
public static int outputInt(int v, char[] b, int off)

Method for appending value of given int value into specified char[].

Note

caller must guarantee that the output buffer has enough room for String representation of the value.

Parameters
v:int

Value to append to buffer

b:char[]

Buffer to append value to: caller must guarantee there is enough room

off:int

Offset within output buffer (b) to append number at

Returns:int

Offset within buffer after outputting int

outputIntback to summary
public static int outputInt(int v, byte[] b, int off)
outputLongback to summary
public static int outputLong(long v, char[] b, int off)

Method for appending value of given long value into specified char[].

Note

caller must guarantee that the output buffer has enough room for String representation of the value.

Parameters
v:long

Value to append to buffer

b:char[]

Buffer to append value to: caller must guarantee there is enough room

off:int

Offset within output buffer (b) to append number at

Returns:int

Offset within buffer after outputting long

outputLongback to summary
public static int outputLong(long v, byte[] b, int off)
toStringback to summary
public static String toString(final double v)
Parameters
v:double

double

Returns:String

double as a string

toStringback to summary
public static String toString(final double v, final boolean useFastWriter)
Parameters
v:double

double

useFastWriter:boolean

whether to use Schubfach algorithm to write output (default false)

Returns:String

double as a string

toStringback to summary
public static String toString(final float v)
Parameters
v:float

float

Returns:String

float as a string

toStringback to summary
public static String toString(final float v, final boolean useFastWriter)
Parameters
v:float

float

useFastWriter:boolean

whether to use Schubfach algorithm to write output (default false)

Returns:String

float as a string