Package com.fasterxml.jackson.core.io
Class NumberOutput
java.lang.Object
com.fasterxml.jackson.core.io.NumberOutput
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleannotFinite(double value) Helper method to verify whether givendoublevalue is finite (regular rational number} or not (NaN or Infinity).static booleannotFinite(float value) Helper method to verify whether givenfloatvalue is finite (regular rational number} or not (NaN or Infinity).static intoutputInt(int v, byte[] b, int off) static intoutputInt(int v, char[] b, int off) Method for appending value of givenintvalue into specifiedchar[].static intoutputLong(long v, byte[] b, int off) static intoutputLong(long v, char[] b, int off) Method for appending value of givenlongvalue into specifiedchar[].static StringtoString(double v) static StringtoString(double v, boolean useFastWriter) static StringtoString(float v) static StringtoString(float v, boolean useFastWriter) static StringtoString(int v) static StringtoString(long v)
-
Constructor Details
-
NumberOutput
public NumberOutput()
-
-
Method Details
-
outputInt
public static int outputInt(int v, char[] b, int off) Method for appending value of givenintvalue into specifiedchar[].NOTE: caller must guarantee that the output buffer has enough room for String representation of the value.
- Parameters:
v- Value to append to bufferb- Buffer to append value to: caller must guarantee there is enough roomoff- Offset within output buffer (b) to append number at- Returns:
- Offset within buffer after outputting
int
-
outputInt
public static int outputInt(int v, byte[] b, int off) -
outputLong
public static int outputLong(long v, char[] b, int off) Method for appending value of givenlongvalue into specifiedchar[].NOTE: caller must guarantee that the output buffer has enough room for String representation of the value.
- Parameters:
v- Value to append to bufferb- Buffer to append value to: caller must guarantee there is enough roomoff- Offset within output buffer (b) to append number at- Returns:
- Offset within buffer after outputting
long
-
outputLong
public static int outputLong(long v, byte[] b, int off) -
toString
-
toString
-
toString
- Parameters:
v- double- Returns:
- double as a string
-
toString
- Parameters:
v- doubleuseFastWriter- whether to use Schubfach algorithm to write output (default false)- Returns:
- double as a string
- Since:
- 2.14
-
toString
- Parameters:
v- float- Returns:
- float as a string
- Since:
- 2.6
-
toString
- Parameters:
v- floatuseFastWriter- whether to use Schubfach algorithm to write output (default false)- Returns:
- float as a string
- Since:
- 2.14
-
notFinite
public static boolean notFinite(double value) Helper method to verify whether givendoublevalue is finite (regular rational number} or not (NaN or Infinity).- Parameters:
value-doublevalue to check- Returns:
- True if number is NOT finite (is Infinity or NaN); false otherwise Since 2.10
-
notFinite
public static boolean notFinite(float value) Helper method to verify whether givenfloatvalue is finite (regular rational number} or not (NaN or Infinity).- Parameters:
value-floatvalue to check- Returns:
- True if number is NOT finite (is Infinity or NaN); false otherwise Since 2.10
-