Class AbstractBigDecimalParser
- java.lang.Object
-
- ch.randelshofer.fastdoubleparser.AbstractNumberParser
-
- ch.randelshofer.fastdoubleparser.AbstractBigDecimalParser
-
- Direct Known Subclasses:
JavaBigDecimalFromByteArray,JavaBigDecimalFromCharArray,JavaBigDecimalFromCharSequence
abstract class AbstractBigDecimalParser extends AbstractNumberParser
-
-
Field Summary
Fields Modifier and Type Field Description static intMANY_DIGITS_THRESHOLDThreshold on the number of input characters for selecting the algorithm optimised for few digits in the significand vs.protected static intMAX_DIGITS_WITHOUT_LEADING_ZEROSSeeJavaBigDecimalParser.protected static longMAX_EXPONENT_NUMBER(package private) static intRECURSION_THRESHOLDThreshold on the number of digits for selecting the recursive algorithm instead of the iterative algorithm.-
Fields inherited from class ch.randelshofer.fastdoubleparser.AbstractNumberParser
CHAR_TO_HEX_MAP, DECIMAL_POINT_CLASS, ILLEGAL_OFFSET_OR_ILLEGAL_LENGTH, OTHER_CLASS, SYNTAX_ERROR, SYNTAX_ERROR_BITS, VALUE_EXCEEDS_LIMITS
-
-
Constructor Summary
Constructors Constructor Description AbstractBigDecimalParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidcheckParsedBigDecimalBounds(boolean illegal, int index, int endIndex, int digitCount, long exponent)protected static booleanhasManyDigits(int length)-
Methods inherited from class ch.randelshofer.fastdoubleparser.AbstractNumberParser
charAt, charAt, charAt, checkBounds, checkBounds, lookupHex, lookupHex
-
-
-
-
Field Detail
-
MANY_DIGITS_THRESHOLD
public static final int MANY_DIGITS_THRESHOLD
Threshold on the number of input characters for selecting the algorithm optimised for few digits in the significand vs. the algorithm for many digits in the significand.Set this to
Integer.MAX_VALUEif you only want to use the algorithm optimised for few digits in the significand.Set this to
0if you only want to use the algorithm for long inputs.Rationale for choosing a specific threshold value: We speculate that we only need to use the algorithm for large inputs if there is zero chance, that we can parse the input with the algorithm for small inputs.
optional significant sign = 1 18 significant digits = 18 optional decimal point in significant = 1 optional exponent = 1 optional exponent sign = 1 10 exponent digits = 10
- See Also:
- Constant Field Values
-
RECURSION_THRESHOLD
static final int RECURSION_THRESHOLD
Threshold on the number of digits for selecting the recursive algorithm instead of the iterative algorithm.Set this to
Integer.MAX_VALUEif you only want to use the iterative algorithm.Set this to
0if you only want to use the recursive algorithm.Rationale for choosing a specific threshold value: The iterative algorithm has a smaller constant overhead than the recursive algorithm. We speculate that we break even somewhere at twice the threshold value.
- See Also:
- Constant Field Values
-
MAX_EXPONENT_NUMBER
protected static final long MAX_EXPONENT_NUMBER
- See Also:
- Constant Field Values
-
MAX_DIGITS_WITHOUT_LEADING_ZEROS
protected static final int MAX_DIGITS_WITHOUT_LEADING_ZEROS
SeeJavaBigDecimalParser.- See Also:
- Constant Field Values
-
-