Class/Object

chain

Chain

Related Docs: object Chain | package chain

Permalink

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
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink

    Concatenate two Chains.

    Concatenate two Chains.

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

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

    Permalink

    Prepend a value to a Chain.

    Prepend a value to a Chain.

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

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

    Permalink

    Append a value to a Chain.

    Append a value to a Chain.

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

  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

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

    Permalink

    Compare two Chain instances.

  10. def compress: Chain[A]

    Permalink

    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.

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

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

    Permalink

    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
  13. def exists(p: (A) ⇒ Boolean): Boolean

    Permalink

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

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

    Permalink

    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.

  15. def finalize(): Unit

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    Loop over this Chain, applying the given function.

    Loop over this Chain, applying the given function.

    This is an O(n) operation.

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

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

    Permalink

    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
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def iterator: Iterator[A]

    Permalink

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

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

    Permalink

    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.

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

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  30. def toIterable: Iterable[A]

    Permalink

    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.

  31. def toString(): String

    Permalink

    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
  32. def toVector: Vector[A]

    Permalink

    Conver this Chain to a Vector.

    Conver this Chain to a Vector.

    This is an O(n) operation.

  33. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped