Package ch.randelshofer.fastdoubleparser
Class AbstractBigIntegerParser
java.lang.Object
ch.randelshofer.fastdoubleparser.AbstractNumberParser
ch.randelshofer.fastdoubleparser.AbstractBigIntegerParser
- Direct Known Subclasses:
JavaBigIntegerFromByteArray,JavaBigIntegerFromCharArray,JavaBigIntegerFromCharSequence
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe resulting value must fit into2^31 - 1bits.private static final intThe resulting value must fit into2^31 - 1bits.(package private) static final intThreshold 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
MAX_DECIMAL_DIGITS
private static final int MAX_DECIMAL_DIGITSThe resulting value must fit into2^31 - 1bits. The decimal representation of2^31 - 1bits has 646,456,993 digits.- See Also:
-
MAX_HEX_DIGITS
private static final int MAX_HEX_DIGITSThe resulting value must fit into2^31 - 1bits. The hexadecimal representation of2^31 - 1bits has 536,870,912 digits.- See Also:
-
RECURSION_THRESHOLD
static final int RECURSION_THRESHOLDThreshold 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:
-
-
Constructor Details
-
AbstractBigIntegerParser
AbstractBigIntegerParser()
-
-
Method Details
-
hasManyDigits
protected static boolean hasManyDigits(int length) -
checkHexBigIntegerBounds
protected static void checkHexBigIntegerBounds(int numDigits) -
checkDecBigIntegerBounds
protected static void checkDecBigIntegerBounds(int numDigits)
-