scala.collection.generic.GenSetFactory

abstract class GenSetFactory[CC[X] <: GenSet[X] with GenSetLike[X, CC[X]]] extends GenericCompanion[CC]

A template for companion objects of Set and subclasses thereof.

Type Members

type Coll = CC[_]

The underlying collection type with unknown element type

  • Attributes
    • protected[this]
  • Definition Classes
    • GenericCompanion

Abstract Value Members From scala.collection.generic.GenSetFactory

abstract def newBuilder[A]: Builder[A, CC[A]]

The default builder for Set objects.

  • A
    • the type of the set’s elements
  • Definition Classes
    • GenSetFactory → GenericCompanion

(defined at scala.collection.generic.GenSetFactory)

Concrete Value Members From scala.collection.generic.GenSetFactory

def setCanBuildFrom[A]: CanBuildFrom[CC[_], A, CC[A]]

The standard CanBuildFrom instance for Set objects.

(defined at scala.collection.generic.GenSetFactory)

Instance Constructors From scala.collection.generic.GenSetFactory

new GenSetFactory()

(defined at scala.collection.generic.GenSetFactory)

Concrete Value Members From scala.collection.generic.GenericCompanion

def apply[A](elems: A*): CC[A]

Creates a collection with the specified elements.

  • A
    • the type of the collection’s elements
  • elems
    • the elements of the created collection
  • returns
    • a new collection with elements elems
  • Definition Classes
    • GenericCompanion

(defined at scala.collection.generic.GenericCompanion)


Concrete Value Members From Implicit scala.collection.parallel.CollectionsHaveToParArray ——————————————————————————–

def toParArray: ParArray[T]

  • Implicit information
    • This member is added by an implicit conversion from GenSetFactory [CC] to CollectionsHaveToParArray [GenSetFactory [CC], T] performed by method CollectionsHaveToParArray in scala.collection.parallel. This conversion will take place only if an implicit value of type (GenSetFactory [CC]) ⇒ GenTraversableOnce [T] is in scope.
  • Definition Classes
    • CollectionsHaveToParArray (added by implicit convertion: scala.collection.parallel.CollectionsHaveToParArray)

Full Source:

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2013, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */



package scala
package collection
package generic

import mutable.Builder
import scala.language.higherKinds

/** A template for companion objects of `Set` and subclasses thereof.
 *
 *  @define coll set
 *  @define Coll `Set`
 *  @define factoryInfo
 *    This object provides a set of operations needed to create `$Coll` values.
 *    @author Martin Odersky
 *    @version 2.8
 *    @since 2.8
 *  @define canBuildFromInfo
 *    The standard `CanBuildFrom` instance for `$Coll` objects.
 *    @see CanBuildFrom
 *  @define setCanBuildFromInfo
 *    The standard `CanBuildFrom` instance for `$Coll` objects.
 *    @see CanBuildFrom
 *    @see GenericCanBuildFrom
 */
abstract class GenSetFactory[CC[X] <: GenSet[X] with GenSetLike[X, CC[X]]]
  extends GenericCompanion[CC] {

  def newBuilder[A]: Builder[A, CC[A]]

  /** $setCanBuildFromInfo
   */
  def setCanBuildFrom[A] = new CanBuildFrom[CC[_], A, CC[A]] {
    def apply(from: CC[_]) = newBuilder[A]
    def apply() = newBuilder[A]
  }
}