Package redempt.crunch.data
Class FastNumberParsing
java.lang.Object
redempt.crunch.data.FastNumberParsing
Utility class with some methods for parsing base 10 numbers (only ints and doubles for now) that are faster than the standard Java implementation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
parseDouble
(String input) Parse a double from base 10 string input, only real number values are supported (no NaN or Infinity)static double
parseDouble
(String input, int start, int end) Parse a double from base 10 string input, only real number values are supported (no NaN or Infinity)static int
Parse an integer from base 10 string inputstatic int
Parse an integer from base 10 string input
-
Constructor Details
-
FastNumberParsing
public FastNumberParsing()
-
-
Method Details
-
parseInt
Parse an integer from base 10 string input- Parameters:
input
- The base 10 string input- Returns:
- The parsed integer
-
parseInt
Parse an integer from base 10 string input- Parameters:
input
- The base 10 string inputstart
- The starting index to parse from, inclusiveend
- The ending index to parse to, exclusive- Returns:
- The parsed integer
-
parseDouble
Parse a double from base 10 string input, only real number values are supported (no NaN or Infinity)- Parameters:
input
- The base 10 string input- Returns:
- The parsed double
-
parseDouble
Parse a double from base 10 string input, only real number values are supported (no NaN or Infinity)- Parameters:
input
- The base 10 string inputstart
- The starting index to parse from, inclusiveend
- The ending index to parse to, exclusive- Returns:
- The parsed double
-