trait TraversableMethods[+A, +This <: TraversableLike[A, This] with Traversable[A]] extends AnyRef

known subclasses: IterableMethods


  1. AnyRef
  2. Any

Value Members

  1. def ++[B >: A, That](that: Traversable[B])(bf: CanBuildFrom[This, B, That]): That

  2. def ++[B >: A, That](that: Iterator[B])(bf: CanBuildFrom[This, B, That]): That

  3. def /:[B](z: B)(op: (B, A) ⇒ B): B

  4. def :\[B](z: B)(op: (A, B) ⇒ B): B

  5. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

  6. def addString(b: StringBuilder, sep: String): StringBuilder

  7. def addString(b: StringBuilder): StringBuilder

  8. def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Unit

  9. def copyToArray[B >: A](xs: Array[B], start: Int): Unit

  10. def copyToBuffer[B >: A](dest: Buffer[B]): Unit

  11. def count(p: (A) ⇒ Boolean): Int

  12. def drop(n: Int): Traversable[A]

  13. def dropWhile(p: (A) ⇒ Boolean): Traversable[A]

  14. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an equivalence relation:

    • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
    • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
    • It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same Int (o1.hashCode.equals(o2.hashCode)).


    the object to compare against this object for equality.


    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef ⇐ Any
  15. def exists(p: (A) ⇒ Boolean): Boolean

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

  17. def filterNot(p: (A) ⇒ Boolean): Traversable[A]

  18. def find(p: (A) ⇒ Boolean): Option[A]

  19. def flatMap[B, That](f: (A) ⇒ Traversable[B])(bf: CanBuildFrom[This, B, That]): That

  20. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B

  21. def foldRight[B](z: B)(op: (A, B) ⇒ B): B

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

  23. def foreach[U](f: (A) ⇒ U): Unit

  24. def groupBy[K](f: (A) ⇒ K): Map[K, Traversable[A]]

  25. def hasDefiniteSize: Boolean

  26. def hashCode(): Int

    Returns a hash code value for the object

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    definition classes: AnyRef ⇐ Any
  27. def head: A

  28. def headOption: Option[A]

  29. def init: Traversable[A]

  30. def isEmpty: Boolean

  31. def last: A

  32. def lastOption: Option[A]

  33. def map[B, That](f: (A) ⇒ B)(bf: CanBuildFrom[This, B, That]): That

  34. def mkString: String

  35. def mkString(start: String, sep: String, end: String): String

  36. def mkString(sep: String): String

  37. def nonEmpty: Boolean

  38. def partialMap[B, That](pf: PartialFunction[A, B])(bf: CanBuildFrom[This, B, That]): That

  39. def partition(p: (A) ⇒ Boolean): (Traversable[A], Traversable[A])

  40. def reduceLeft[B >: A](op: (B, A) ⇒ B): B

  41. def reduceLeftOption[B >: A](op: (B, A) ⇒ B): Option[B]

  42. def reduceRight[B >: A](op: (A, B) ⇒ B): B

  43. def reduceRightOption[B >: A](op: (A, B) ⇒ B): Option[B]

  44. def size: Int

  45. def slice(from: Int, until: Int): Traversable[A]

  46. def span(p: (A) ⇒ Boolean): (Traversable[A], Traversable[A])

  47. def splitAt(n: Int): (Traversable[A], Traversable[A])

  48. def stringPrefix: String

  49. def tail: Traversable[A]

  50. def take(n: Int): Traversable[A]

  51. def takeWhile(p: (A) ⇒ Boolean): Traversable[A]

  52. def toArray[B >: A](arg0: ClassManifest[B]): Array[B]

  53. def toIndexedSeq[B >: A]: IndexedSeq[B]

  54. def toIterable: Iterable[A]

  55. def toList: List[A]

  56. def toSeq: Seq[A]

  57. def toSet[B >: A]: Set[B]

  58. def toStream: Stream[A]

  59. def toString(): String

    Returns a string representation of the object

    Returns a string representation of the object.

    The default representation is platform dependent.

    definition classes: AnyRef ⇐ Any
  60. def view(from: Int, until: Int): TraversableView[A, This]

  61. def view: TraversableView[A, This]