blob: 8a215a0bf2dff3944b7d7204c5725ae2cb2be155 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
package scala.collection
import generic._
/** <p>
* A set is a collection that includes at most one of any object.
* </p>
* <p>
*
* @author Matthias Zenger
* @author Martin Odersky
* @version 2.8
*/
trait Set[A] extends (A => Boolean)
with Iterable[A]
with SetClass[A, Set]
with SetTemplate[A, Set[A]] {
override def companion: Companion[Set] = Set
}
/* Factory object for `Set` class */
object Set extends SetFactory[Set] {
override def empty[A]: Set[A] = immutable.Set.empty[A]
implicit def builderFactory[A]: BuilderFactory[A, Set[A], Coll] = setBuilderFactory[A]
}
/* !!! what to do about this?
override def hashCode() =
(0 /: this)((hash, e) => hash + e.hashCode())
override def toArray[B >: A]: Array[B] = {
val result = new Array[B](size)
copyToArray(result, 0)
result
}
/** Defines the prefix of this object's <code>toString</code> representation.
*/
override protected def stringPrefix : String = "Set"
*/
|