Class FastNumberParsing

java.lang.Object
redempt.crunch.data.FastNumberParsing

public class FastNumberParsing extends Object
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    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 input
    static int
    parseInt(String input, int start, int end)
    Parse an integer from base 10 string input

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FastNumberParsing

      public FastNumberParsing()
  • Method Details

    • parseInt

      public static int parseInt(String input)
      Parse an integer from base 10 string input
      Parameters:
      input - The base 10 string input
      Returns:
      The parsed integer
    • parseInt

      public static int parseInt(String input, int start, int end)
      Parse an integer from base 10 string input
      Parameters:
      input - The base 10 string input
      start - The starting index to parse from, inclusive
      end - The ending index to parse to, exclusive
      Returns:
      The parsed integer
    • parseDouble

      public static double parseDouble(String input)
      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

      public 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)
      Parameters:
      input - The base 10 string input
      start - The starting index to parse from, inclusive
      end - The ending index to parse to, exclusive
      Returns:
      The parsed double