Package

jawn

util

Permalink

package util

Linear Supertypes
AnyRef, Any
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. class InvalidLong extends NumberFormatException

    Permalink
  2. final class Slice extends CharSequence with Serializable

    Permalink

    Character sequence representing a lazily-calculated substring.

    Character sequence representing a lazily-calculated substring.

    This class has three constructors:

    • Slice(s) wraps a string, ensuring that future operations (e.g. subSequence) will construct slices instead of strings.
    • Slice(s, start, limit) is the default, and ensures that:
      1. start >= 0 2. limit >= start 3. limit <= s.length
    • Slice.unsafe(s, start, limit) is for situations where the above bounds-checking has already occurred. Only use this if you are absolutely sure your arguments satisfy the above invariants.

    Slice's subSequence returns another slice. This means that when wrapping a very large string, garbage collection on the underlying string will not occur until all slices are freed.

    Slice's universal equality is only defined with regard to other slices. This means comparing a Slice with other CharSequence values (including String) will always return false.

    Slices are serializable. However! They use the default Java serialization layout, which is not that efficient, and could be a disaster in cases where a large shared string might be serialized many times in different slices.

    Annotations
    @SerialVersionUID()

Value Members

  1. object InvalidLong extends Serializable

    Permalink
  2. object Slice extends Serializable

    Permalink
  3. def parseLong(cs: CharSequence): Long

    Permalink

    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.

  4. def parseLongUnsafe(cs: CharSequence): Long

    Permalink

    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).

Inherited from AnyRef

Inherited from Any

Ungrouped