Class UnsignedLongs.ParseOverflowDetection

  • Enclosing class:
    UnsignedLongs

    private static final class UnsignedLongs.ParseOverflowDetection
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int[] maxSafeDigits  
      (package private) static long[] maxValueDivs  
      (package private) static int[] maxValueMods  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static boolean overflowInParse​(long current, int digit, int radix)
      Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • maxValueDivs

        static final long[] maxValueDivs
      • maxValueMods

        static final int[] maxValueMods
      • maxSafeDigits

        static final int[] maxSafeDigits
    • Constructor Detail

      • ParseOverflowDetection

        private ParseOverflowDetection()
    • Method Detail

      • overflowInParse

        static boolean overflowInParse​(long current,
                                       int digit,
                                       int radix)
        Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long. This is useful for detecting overflow while parsing a string representation of a number. Does not verify whether supplied radix is valid, passing an invalid radix will give undefined results or an ArrayIndexOutOfBoundsException.