Package ch.randelshofer.fastdoubleparser
Class AbstractBigIntegerParser
- java.lang.Object
-
- ch.randelshofer.fastdoubleparser.AbstractNumberParser
-
- ch.randelshofer.fastdoubleparser.AbstractBigIntegerParser
-
- Direct Known Subclasses:
JavaBigIntegerFromByteArray,JavaBigIntegerFromCharArray,JavaBigIntegerFromCharSequence
abstract class AbstractBigIntegerParser extends AbstractNumberParser
-
-
Field Summary
Fields Modifier and Type Field Description private static intMAX_DECIMAL_DIGITSThe resulting value must fit into2^31 - 1bits.private static intMAX_HEX_DIGITSThe resulting value must fit into2^31 - 1bits.(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 AbstractBigIntegerParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidcheckDecBigIntegerBounds(int numDigits)protected static voidcheckHexBigIntegerBounds(int numDigits)protected static booleanhasManyDigits(int length)-
Methods inherited from class ch.randelshofer.fastdoubleparser.AbstractNumberParser
charAt, charAt, charAt, checkBounds, checkBounds, lookupHex, lookupHex
-
-
-
-
Field Detail
-
MAX_DECIMAL_DIGITS
private static final int MAX_DECIMAL_DIGITS
The resulting value must fit into2^31 - 1bits. The decimal representation of2^31 - 1bits has 646,456,993 digits.- See Also:
- Constant Field Values
-
MAX_HEX_DIGITS
private static final int MAX_HEX_DIGITS
The resulting value must fit into2^31 - 1bits. The hexadecimal representation of2^31 - 1bits has 536,870,912 digits.- 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
-
-