Package ch.randelshofer.fastdoubleparser
Class JavaBigDecimalFromCharArray
- java.lang.Object
-
- ch.randelshofer.fastdoubleparser.AbstractNumberParser
-
- ch.randelshofer.fastdoubleparser.AbstractBigDecimalParser
-
- ch.randelshofer.fastdoubleparser.JavaBigDecimalFromCharArray
-
final class JavaBigDecimalFromCharArray extends AbstractBigDecimalParser
Parses adoublefrom abytearray.
-
-
Field Summary
-
Fields inherited from class ch.randelshofer.fastdoubleparser.AbstractBigDecimalParser
MANY_DIGITS_THRESHOLD, MAX_DIGITS_WITHOUT_LEADING_ZEROS, MAX_EXPONENT_NUMBER, RECURSION_THRESHOLD
-
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 JavaBigDecimalFromCharArray()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalparseBigDecimalString(char[] str, int offset, int length)Parses aBigDecimalStringas specified inJavaBigDecimalParser.(package private) java.math.BigDecimalparseBigDecimalStringWithManyDigits(char[] str, int offset, int length)Parses a big decimal string that has many digits.(package private) java.math.BigDecimalvalueOfBigDecimalString(char[] str, int integerPartIndex, int decimalPointIndex, int nonZeroFractionalPartIndex, int exponentIndicatorIndex, boolean isNegative, int exponent)Parses a big decimal string after we have identified the parts of the significand, and after we have obtained the exponent value.-
Methods inherited from class ch.randelshofer.fastdoubleparser.AbstractBigDecimalParser
checkParsedBigDecimalBounds, hasManyDigits
-
Methods inherited from class ch.randelshofer.fastdoubleparser.AbstractNumberParser
charAt, charAt, charAt, checkBounds, checkBounds, lookupHex, lookupHex
-
-
-
-
Method Detail
-
parseBigDecimalString
public java.math.BigDecimal parseBigDecimalString(char[] str, int offset, int length)Parses aBigDecimalStringas specified inJavaBigDecimalParser.- Parameters:
str- the input stringoffset- start of the input datalength- length of the input data- Returns:
- the parsed
BigDecimal - Throws:
java.lang.NullPointerException- if str is nulljava.lang.IllegalArgumentException- if offset or length are illegaljava.lang.NumberFormatException- if the input string can not be parsed successfully
-
parseBigDecimalStringWithManyDigits
java.math.BigDecimal parseBigDecimalStringWithManyDigits(char[] str, int offset, int length)Parses a big decimal string that has many digits.
-
valueOfBigDecimalString
java.math.BigDecimal valueOfBigDecimalString(char[] str, int integerPartIndex, int decimalPointIndex, int nonZeroFractionalPartIndex, int exponentIndicatorIndex, boolean isNegative, int exponent)Parses a big decimal string after we have identified the parts of the significand, and after we have obtained the exponent value.integerPartIndex │ decimalPointIndex │ │ nonZeroFractionalPartIndex │ │ │ exponentIndicatorIndex ↓ ↓ ↓ ↓ "-123.00456e-789"- Parameters:
str- the input stringintegerPartIndex- the start index of the integer part of the significanddecimalPointIndex- the index of the decimal point in the significand (same as exponentIndicatorIndex if there is no decimal point)nonZeroFractionalPartIndex- the start index of the non-zero fractional part of the significandexponentIndicatorIndex- the index of the exponent indicator (same as end of string if there is no exponent indicator)isNegative- indicates that the significand is negativeexponent- the exponent value- Returns:
- the parsed big decimal
-
-