chain

Chain

sealed abstract class Chain[+A] extends AnyRef

Chain wraps Iterable[A] instances to enable fast concatenation and traversal.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Chain
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Chain()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++[A1 >: A](that: Chain[A1]): Chain[A1]

    Concatenate two Chains.

    Concatenate two Chains.

    This is a fast O(1) operation: it simply returns a new Chain.Concat instance wrapping the arguments.

  5. def +:[A1 >: A](a: A1): Chain[A1]

    Prepend a value to a Chain.

    Prepend a value to a Chain.

    (a +: x) is equivalent to (Chain.single(a) ++ x).

  6. def :+[A1 >: A](a: A1): Chain[A1]

    Append a value to a Chain.

    Append a value to a Chain.

    (x :+ a) is equivalent to (x ++ Chain.single(a)).

  7. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def compare[A1 >: A](that: Chain[A1])(implicit ev: Ordering[A1]): Int

    Compare two Chain instances.

  12. def compress: Chain[A]

    Compress a Chain, removing its internal structure.

    Compress a Chain, removing its internal structure.

    In general, this is an O(n) operation which will compact this Chain into a single Chain.Elems instance wrapping a vector. However, if the Chain is already compressed (i.e. Chain.Elems) this does not do any work or allocate a new Chain.

    When working with a large number of very small collections, this method can have a big impact.

  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(that: Any): Boolean

    Universal equality for Chain.

    Universal equality for Chain.

    In the worst-case this is an O(n) operation, but may be faster due to type mistmatches or finding unequal elements early in the Chains.

    Definition Classes
    Chain → AnyRef → Any
  15. def exists(p: (A) ⇒ Boolean): Boolean

    Return whether the predicate is true for any elements or not.

  16. def filter(p: (A) ⇒ Boolean): Chain[A]

    Filter out some elements of a Chain given a predicate.

    Filter out some elements of a Chain given a predicate.

    This is an O(n) operation.

    The resulting Chain will naturally be compressed.

  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def find(p: (A) ⇒ Boolean): Option[A]

    Search for the first element that satisfies the given predicate.

    Search for the first element that satisfies the given predicate.

    In the worst-case this is an O(n) operation, but it will short-circuit as soon as a single match is found.

  19. def flatMap[B](f: (A) ⇒ Chain[B]): Chain[B]

    Translate a Chain using the given function.

    Translate a Chain using the given function.

    This is an O(n * m) operation, where n is the length of this Chain and m represents the average length of the Chain instances produced by f.

  20. def foldLeft[B](b: B)(f: (B, A) ⇒ B): B

    Combine the elements of a Chain into a single value, using a starter value and an associative function.

  21. def forall(p: (A) ⇒ Boolean): Boolean

    Return whether the predicate is true for all elements or not.

  22. def foreach(f: (A) ⇒ Unit): Unit

    Loop over this Chain, applying the given function.

    Loop over this Chain, applying the given function.

    This is an O(n) operation.

  23. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  24. def hashCode(): Int

    Hash codes for Chain.

    Hash codes for Chain.

    This is an O(n) operation. It is consistent with equals. This means that if (x == y) then (x.hashCode == y.hashCode).

    Definition Classes
    Chain → AnyRef → Any
  25. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  26. def iterator: Iterator[A]

    Return an iterator over the contents of this Chain.

    Return an iterator over the contents of this Chain.

    This is a fast O(1) operation, although traversing the iterator is itself an O(n) operation (which also uses O(n) heap).

  27. def map[B](f: (A) ⇒ B): Chain[B]

    Translate a Chain using the given function.

    Translate a Chain using the given function.

    This is an O(n) operation.

    The resulting Chain will naturally be compressed.

  28. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. def toIterable: Iterable[A]

    Allow this Chain to be used where Iterable[A] is required.

    Allow this Chain to be used where Iterable[A] is required.

    By default Chain does not extend Iterable[A], to avoid inheriting inefficient methods from that API.

    This is a fast O(1) operation.

  33. def toString(): String

    Produce a string representation of this Chain.

    Produce a string representation of this Chain.

    This is an O(n) operation, which will display the entire contents of the Chain.

    Definition Classes
    Chain → AnyRef → Any
  34. def toVector: Vector[A]

    Conver this Chain to a Vector.

    Conver this Chain to a Vector.

    This is an O(n) operation.

  35. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped