Trait BuildFrom.BuildFrom

Companion object • Source code



trait BuildFrom[-From, -A, +C]


Builds a collection of type C from elements of type A when a source collection of type From is available. Implicit instances of BuildFrom are available for all collection types. 


Type parameters

A
Type of elements (e.g. Int, Boolean, etc.)
C
Type of collection (e.g. List[Int], TreeMap[Int, String], etc.)
From
Type of source collection



Supertypes
class Any



Self type

BuildFrom[From, A, C]


Abstract methods

Source
def fromSpecific(from: From)(it: IterableOnce[A]): C



Source
def newBuilder(from: From): Builder[A, C]


Get a Builder for the collection. For non-strict collection types this will use an intermediate buffer. Building collections with fromSpecific is preferred because it can be lazy for lazy collections.
Concrete methods

Source
def toFactory(from: From): Factory[A, C]


Partially apply a BuildFrom to a Factory


    
{'path': 'public/docs/scala~3.2/scala/collection/buildfrom.html', 'source': 'DevDocs.IO'}