trait GenericParTemplate[+A, +CC[X] <: ParIterable[X]] extends GenericTraversableTemplate[A, CC] with HasNewCombiner[A, CC[A]]
A template trait for collections having a companion.
- A
the element type of the collection
- CC
the type constructor representing the collection class
- Since
2.8
- Alphabetic
- By Inheritance
- GenericParTemplate
- HasNewCombiner
- GenericTraversableTemplate
- HasNewBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract def companion: GenericParCompanion[CC]
The factory companion object that builds instances of class $Coll.
The factory companion object that builds instances of class $Coll. (or its
Iterable
superclass where class $Coll is not aSeq
.)- Definition Classes
- GenericParTemplate → GenericTraversableTemplate
- abstract def head: A
Selects the first element of this collection.
Selects the first element of this collection.
- returns
the first element of this collection.
- Definition Classes
- GenericTraversableTemplate
- Exceptions thrown
NoSuchElementException
if the collection is empty.
- abstract def isEmpty: Boolean
Tests whether this collection is empty.
Tests whether this collection is empty.
- returns
true
if the collection contain no elements,false
otherwise.
- Definition Classes
- GenericTraversableTemplate
- abstract def seq: scala.Iterable[A]
A sequential collection containing the same elements as this collection
A sequential collection containing the same elements as this collection
- Definition Classes
- GenericTraversableTemplate
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatten[B]: <error>
[use case] Converts this collection of traversable collections into a collection formed by the elements of these traversable collections.
[use case]Converts this collection of traversable collections into a collection formed by the elements of these traversable collections.
The resulting collection's type will be guided by the static type of collection. For example:
val xs = List( Set(1, 2, 3), Set(1, 2, 3) ).flatten // xs == List(1, 2, 3, 1, 2, 3) val ys = Set( List(1, 2, 3), List(3, 2, 1) ).flatten // ys == Set(1, 2, 3)
- B
the type of the elements of each traversable collection.
- returns
a new collection resulting from concatenating all element collections.
- Definition Classes
- GenericTraversableTemplate
Full Signaturedef flatten[B](implicit asTraversable: (A) => scala.IterableOnce[B]): CC[B]
- abstract def foreach(f: (A) => Unit): Unit
[use case]
[use case]- f
the function that is applied for its side-effect to every element. The result of function
f
is discarded.
- Definition Classes
- GenericTraversableTemplate
Full Signatureabstract def foreach[U](f: (A) => U): Unit
- def genericBuilder[B]: Combiner[B, CC[B]]
The generic builder that builds instances of $Coll at arbitrary element types.
The generic builder that builds instances of $Coll at arbitrary element types.
- Definition Classes
- GenericParTemplate → GenericTraversableTemplate
- def genericCombiner[B]: Combiner[B, CC[B]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newBuilder: Builder[A, CC[A]]
The builder that builds instances of type $Coll[A]
The builder that builds instances of type $Coll[A]
- Attributes
- protected[this]
- Definition Classes
- GenericParTemplate → GenericTraversableTemplate → HasNewBuilder
- def newCombiner: Combiner[A, CC[A]]
- Attributes
- protected[this]
- Definition Classes
- GenericParTemplate → HasNewCombiner
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transpose[B](implicit asTraversable: (A) => scala.IterableOnce[B]): CC[CC[B]]
Transposes this collection of traversable collections into a collection of collections.
Transposes this collection of traversable collections into a collection of collections.
The resulting collection's type will be guided by the static type of collection. For example:
val xs = List( Set(1, 2, 3), Set(4, 5, 6)).transpose // xs == List( // List(1, 4), // List(2, 5), // List(3, 6)) val ys = Vector( List(1, 2, 3), List(4, 5, 6)).transpose // ys == Vector( // Vector(1, 4), // Vector(2, 5), // Vector(3, 6))
- B
the type of the elements of each traversable collection.
- asTraversable
an implicit conversion which asserts that the element type of this collection is a
Traversable
.- returns
a two-dimensional collection of collections which has as nth row the nth column of this collection.
- Definition Classes
- GenericTraversableTemplate
- Annotations
- @migration
- Migration
(Changed in version 2.9.0)
transpose
throws anIllegalArgumentException
if collections are not uniformly sized.- Exceptions thrown
IllegalArgumentException
if all collections in this collection are not of the same size.
- def unzip[A1, A2](implicit asPair: (A) => (A1, A2)): (CC[A1], CC[A2])
Converts this collection of pairs into two collections of the first and second half of each pair.
Converts this collection of pairs into two collections of the first and second half of each pair.
val xs = $Coll( (1, "one"), (2, "two"), (3, "three")).unzip // xs == ($Coll(1, 2, 3), // $Coll(one, two, three))
- A1
the type of the first half of the element pairs
- A2
the type of the second half of the element pairs
- asPair
an implicit conversion which asserts that the element type of this collection is a pair.
- returns
a pair of collections, containing the first, respectively second half of each element pair of this collection.
- Definition Classes
- GenericTraversableTemplate
- def unzip3[A1, A2, A3](implicit asTriple: (A) => (A1, A2, A3)): (CC[A1], CC[A2], CC[A3])
Converts this collection of triples into three collections of the first, second, and third element of each triple.
Converts this collection of triples into three collections of the first, second, and third element of each triple.
val xs = $Coll( (1, "one", '1'), (2, "two", '2'), (3, "three", '3')).unzip3 // xs == ($Coll(1, 2, 3), // $Coll(one, two, three), // $Coll(1, 2, 3))
- A1
the type of the first member of the element triples
- A2
the type of the second member of the element triples
- A3
the type of the third member of the element triples
- asTriple
an implicit conversion which asserts that the element type of this collection is a triple.
- returns
a triple of collections, containing the first, second, respectively third member of each element triple of this collection.
- Definition Classes
- GenericTraversableTemplate
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()