Class/Object

cats.data

Chain

Related Docs: object Chain | package data

Permalink

sealed abstract class Chain[+A] extends AnyRef

Trivial catenable sequence. Supports O(1) append, and (amortized) O(1) uncons, such that walking the sequence via N successive uncons steps takes O(N).

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

Abstract Value Members

  1. abstract def isEmpty: Boolean

    Permalink

    Returns true if there are no elements in this collection.

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ++[A2 >: A](c: Chain[A2]): Chain[A2]

    Permalink

    Alias for concat

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

    Permalink

    Alias for prepend.

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

    Permalink

    Alias for append.

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

    Permalink
    Definition Classes
    AnyRef → Any
  7. def ===[AA >: A](that: Chain[AA])(implicit A: Eq[AA]): Boolean

    Permalink

    Typesafe equality operator.

    Typesafe equality operator.

    This method is similar to == except that it only allows two Chain[A] values to be compared to each other, and uses equality provided by Eq[_] instances, rather than using the universal equality provided by .equals.

  8. final def append[A2 >: A](a: A2): Chain[A2]

    Permalink

    Returns a new Chain consisting of this followed by a.

    Returns a new Chain consisting of this followed by a. O(1) runtime.

  9. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def collect[B](pf: PartialFunction[A, B]): Chain[B]

    Permalink

    Collect B from this for which f is defined

  12. final def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

    Permalink

    Finds the first element of this Chain for which the given partial function is defined, and applies the partial function to it.

  13. final def collectFirstSome[B](f: (A) ⇒ Option[B]): Option[B]

    Permalink

    Like collectFirst from scala.collection.Traversable but takes A => Option[B] instead of PartialFunctions.

  14. final def concat[A2 >: A](c: Chain[A2]): Chain[A2]

    Permalink

    Concatenates this with c in O(1) runtime.

  15. final def contains[AA >: A](a: AA)(implicit A: Eq[AA]): Boolean

    Permalink

    Check whether an element is in this structure

  16. final def deleteFirst(f: (A) ⇒ Boolean): Option[(A, Chain[A])]

    Permalink

    Yields to Some(a, Chain[A]) with a removed where f holds for the first time, otherwise yields None, if a was not found Traverses only until a is found.

  17. def distinct[AA >: A](implicit O: Order[AA]): Chain[AA]

    Permalink

    Remove duplicates.

    Remove duplicates. Duplicates are checked using Order[_] instance.

  18. final def dropWhile(p: (A) ⇒ Boolean): Chain[A]

    Permalink

    Drops longest prefix of elements that satisfy a predicate.

    Drops longest prefix of elements that satisfy a predicate.

    p

    The predicate used to test elements.

    returns

    the longest suffix of this sequence whose first element does not satisfy the predicate p.

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

    Permalink
    Definition Classes
    AnyRef
  20. def equals(o: Any): Boolean

    Permalink
    Definition Classes
    Chain → AnyRef → Any
  21. final def exists(f: (A) ⇒ Boolean): Boolean

    Permalink

    Check whether at least one element satisfies the predicate

  22. final def filter(f: (A) ⇒ Boolean): Chain[A]

    Permalink

    Remove elements not matching the predicate

  23. final def filterNot(f: (A) ⇒ Boolean): Chain[A]

    Permalink

    Remove elements matching the predicate

  24. def finalize(): Unit

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

    Permalink

    Find the first element matching the predicate, if one exists

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

    Permalink

    Applies the supplied function to each element and returns a new Chain from the concatenated results

  27. final def foldLeft[B](z: B)(f: (B, A) ⇒ B): B

    Permalink

    Folds over the elements from left to right using the supplied initial value and function.

  28. final def foldRight[B](z: B)(f: (A, B) ⇒ B): B

    Permalink

    Folds over the elements from right to left using the supplied initial value and function.

  29. final def forall(f: (A) ⇒ Boolean): Boolean

    Permalink

    Check whether all elements satisfy the predicate

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

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def groupBy[B](f: (A) ⇒ B)(implicit B: Order[B]): SortedMap[B, NonEmptyChain[A]]

    Permalink

    Groups elements inside this Chain according to the Order of the keys produced by the given mapping function.

  32. def hash[AA >: A](implicit hashA: Hash[AA]): Int

    Permalink
  33. def hashCode(): Int

    Permalink
    Definition Classes
    Chain → AnyRef → Any
  34. def headOption: Option[A]

    Permalink

    Returns the head of this Chain if non empty, none otherwise.

    Returns the head of this Chain if non empty, none otherwise. Amortized O(1).

  35. final def initLast: Option[(Chain[A], A)]

    Permalink

    Returns the init and last of this Chain if non empty, none otherwise.

    Returns the init and last of this Chain if non empty, none otherwise. Amortized O(1).

  36. final def isInstanceOf[T0]: Boolean

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

    Permalink
  38. final def lastOption: Option[A]

    Permalink

    Returns the last of this Chain if non empty, none otherwise.

    Returns the last of this Chain if non empty, none otherwise. Amortized O(1).

  39. final def length: Long

    Permalink

    Returns the number of elements in this structure

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

    Permalink

    Applies the supplied function to each element and returns a new Chain.

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

    Permalink
    Definition Classes
    AnyRef
  42. final def nonEmpty: Boolean

    Permalink

    Returns false if there are no elements in this collection.

  43. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  45. final def prepend[A2 >: A](a: A2): Chain[A2]

    Permalink

    Returns a new Chain consisting of a followed by this.

    Returns a new Chain consisting of a followed by this. O(1) runtime.

  46. def reverse: Chain[A]

    Permalink

    Reverses this Chain

  47. final def reverseIterator: Iterator[A]

    Permalink
  48. def show[AA >: A](implicit AA: Show[AA]): String

    Permalink
  49. final def size: Long

    Permalink

    Alias for length

  50. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  51. final def takeWhile(p: (A) ⇒ Boolean): Chain[A]

    Permalink

    Takes longest prefix of elements that satisfy a predicate.

    Takes longest prefix of elements that satisfy a predicate.

    p

    The predicate used to test elements.

    returns

    the longest prefix of this chain whose elements all satisfy the predicate p.

  52. final def toList: List[A]

    Permalink

    Converts to a list.

  53. def toString(): String

    Permalink
    Definition Classes
    Chain → AnyRef → Any
  54. final def toVector: Vector[A]

    Permalink

    Converts to a vector.

  55. final def uncons: Option[(A, Chain[A])]

    Permalink

    Returns the head and tail of this Chain if non empty, none otherwise.

    Returns the head and tail of this Chain if non empty, none otherwise. Amortized O(1).

  56. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def zipWith[B, C](other: Chain[B])(f: (A, B) ⇒ C): Chain[C]

    Permalink

    Zips this Chain with another Chain and applies a function for each pair of elements.

Inherited from AnyRef

Inherited from Any

Ungrouped