Packages

p

debox

package debox

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. final class Buffer[A] extends Serializable

    Buffer is a mutable, indexed sequence of values.

    Buffer is a mutable, indexed sequence of values.

    Buffer wraps an underlying array, which provides constant-time lookups, updates, and length checks. Values can be appended to or popped from the end of the buffer in amortized constant time. Other operations, such as insert, prepend, and will be linear.

    In cases where the type A is known (or the caller is specialized on A), Buffer[A] will store the values in an unboxed array, and will not box values on access or update. To aid in specialization and to avoid inheriting bogus methods, Buffer intentionally does not implement any of Scala's collection traits.

    For interop purposes, the toIterable method wraps a buffer in a collections-compatible Iterable[A]. Buffer's iterator method returns an Iterator[A], and the conversion methods .toArray, toVector, and toList are also available.

    To facilitate inlining, Buffer's internals are public. However, you should refrain from accessing or modifying these values unless you know what you are doing.

    Furthermore, since Buffer is really only useful in cases where you care about space efficiency and performance, Buffer declines to do error-checking above what is provided by the underlying array, or which is necessary to avoid corruption. This means that if you try to access an element beyond the Buffer's length, you are not guaranteed to get an exception (although you will in many cases). This is by design. However, calls which modify the buffer using an invalid index are guaranteed not to corrupt the buffer.

    Finally, there is no attempt made to provide any kind of thread safety or protection against concurrent updates. Modify a Buffer during foreach, map, iterator, etc will produce undefined results.

  2. case class DeboxOverflowError(n: Int) extends Exception with Product with Serializable
  3. case class KeyNotFoundException(k: String) extends Exception with Product with Serializable
  4. trait LowPriorityBufferImplicits extends AnyRef
  5. final class Map[A, B] extends Serializable

    Map is a mutable hash map, with open addressing and double hashing.

    Map is a mutable hash map, with open addressing and double hashing.

    Map provides constant-time membership tests and access, and amortized constant-time addition and removal. One underlying array stores keys, another stores values, and another tracks which buckets are used and defined.

    The hashing mechanism is exactly the same as that used in debox.Set, which means that constructing a Set from the keys is relatively fast.

    When the generic types are known (or the caller is specialized on them), Map[A, B] will store the keys and values in unboxed arrays.

    One fundamental difference between debox.Map and Scala's various map types is that debox.Map does not claim to contain tuples, and most of methods handle keys and values as separate parameters, rather than item tuples. This means that methods like foreach() and mapKey() take Function2 instances rather than Function1 instances.

    It also means that instead of generic Tuple2 => Tuple2 functions, Debox uses more specialized methods. For example:

    // Scala version scalaMap.map { case (k, v) => (k, v + 3) }

    // Debox versions deboxMap.mapValues(v => v + 3) // best deboxMap.mapItems((k, v) => (k, v + 3)) // allocs unnecessary tuples deboxMap.

    This means that the Debox Map API has some real differences compared to Scala's API, so please check the methods you are using.

  6. final class Set[A] extends Serializable

    Set is a mutable hash set, with open addressing and double hashing.

    Set is a mutable hash set, with open addressing and double hashing.

    Set provides constant-time membership tests, and amortized constant-time addition and removal. One underlying array stores items, and another tracks which buckets are used and defined.

    When the type A is known (or the caller is specialized on A), Set[A] will store the values in an unboxed array.

  7. class Unit1[A] extends AnyRef
  8. class Unit2[A, B] extends AnyRef

Value Members

  1. object Buffer extends LowPriorityBufferImplicits with Serializable
  2. object Map extends Serializable
  3. object Set extends Serializable
  4. object Util

Ungrouped