Scala Library: GenericCanBuildFrom
scala.collection.generic.OrderedTraversableFactory#GenericCanBuildFrom
class GenericCanBuildFrom[A] extends CanBuildFrom[CC[_], A, CC[A]]Instance Constructors From scala.collection.generic.OrderedTraversableFactory.GenericCanBuildFrom ——————————————————————————–
new GenericCanBuildFrom()(implicit ord: Ordering[A])
(defined at scala.collection.generic.OrderedTraversableFactory.GenericCanBuildFrom)
Value Members From scala.collection.generic.OrderedTraversableFactory.GenericCanBuildFrom ——————————————————————————–
def apply(): Builder[A, CC[A]]
Creates a new builder from scratch.
- returns
- a builder for collections of type
Towith element typeElem.
- a builder for collections of type
- Definition Classes
- GenericCanBuildFrom → CanBuildFrom
- See also
- scala.collection.breakOut
(defined at scala.collection.generic.OrderedTraversableFactory.GenericCanBuildFrom)
def apply(from: CC[_]): Builder[A, CC[A]]
Creates a new builder on request of a collection.
- from
- the collection requesting the builder to be created.
- returns
- a builder for collections of type
Towith element typeElem. The collections framework usually arranges things so that the created builder will build the same kind of collection asfrom.
- a builder for collections of type
- Definition Classes
- GenericCanBuildFrom → CanBuildFrom
(defined at scala.collection.generic.OrderedTraversableFactory.GenericCanBuildFrom)
Value Members From Implicit scala.collection.parallel.CollectionsHaveToParArray ——————————————————————————–
def toParArray: ParArray[T]
- Implicit information
- This member is added by an implicit conversion from GenericCanBuildFrom [A] to CollectionsHaveToParArray [GenericCanBuildFrom [A], T] performed by method CollectionsHaveToParArray in scala.collection.parallel. This conversion will take place only if an implicit value of type ( GenericCanBuildFrom [A]) ⇒ GenTraversableOnce [T] is in scope.
- Definition Classes
- CollectionsHaveToParArray (added by implicit convertion: scala.collection.parallel.CollectionsHaveToParArray)
Full Source:
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala
package collection
package generic
import scala.language.higherKinds
abstract class OrderedTraversableFactory[CC[X] <: Traversable[X] with GenericOrderedTraversableTemplate[X, CC]]
extends GenericOrderedCompanion[CC] {
class GenericCanBuildFrom[A](implicit ord: Ordering[A]) extends CanBuildFrom[CC[_], A, CC[A]] {
def apply(from: CC[_]) = from.genericOrderedBuilder[A]
def apply = newBuilder[A]
}
}Interested in Scala?
I send out weekly, personalized emails with articles and conference talks.
Subscribe now.