Packages

package util

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. util
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class InvalidLong extends NumberFormatException with NoStackTrace

Value Members

  1. val MaxSafeLongLength: Int

    Any strings under this length which parse as numbers that lack decimals or exponents may be safely consumed using parseLongUnsafe.

  2. def parseLong(cs: CharSequence): Long

    Parse the given character sequence as a single Long value (64-bit signed integer) in decimal (base-10).

    Parse the given character sequence as a single Long value (64-bit signed integer) in decimal (base-10).

    Other than "0", leading zeros are not allowed, nor are leading plusses. At most one leading minus is allowed. The value "-0" is allowed, and is interpreted as 0.

    Stated more precisely, accepted values:

    • conform to the pattern: -?(0|([1-9][0-9]*))
    • are within [-9223372036854775808, 9223372036854775807]

    This method will throw an InvalidLong exception on invalid input.

    Annotations
    @SuppressWarnings()
  3. def parseLongUnsafe(cs: CharSequence): Long

    Parse the given character sequence as a single Long value (64-bit signed integer) in decimal (base-10).

    Parse the given character sequence as a single Long value (64-bit signed integer) in decimal (base-10).

    For valid inputs, this method produces the same values as parseLong. However, by avoiding input validation it is up to 50% faster.

    For inputs which parseLong throws an error on, parseLongUnsafe may (or may not) throw an error, or return a bogus value. This method makes no guarantees about how it handles invalid input.

    This method should only be used on sequences which have already been parsed (e.g. by a Jawn parser). When in doubt, use parseLong(cs), which is still significantly faster than java.lang.Long.parseLong(cs.toString).

    Annotations
    @SuppressWarnings()
  4. object InvalidLong extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped