scala.collection.immutable

trait Set

[source: scala/collection/immutable/Set.scala]

trait Set[A]
extends Iterable[A] with Set[A] with GenericSetTemplate[A, Set] with SetLike[A, Set[A]]

A generic trait for immutable sets. Concrete set implementations have to provide functionality for the abstract methods in Set:

    def contains(elem: A): Boolean
    def iterator: Iterator[A]
    def + (elem: A): This
    def - (elem: A): This

where This is the type of the set.

Author
Matthias Zenger
Martin Odersky
Version
2.8
Since
1
Direct Known Subclasses:
Enumeration.ValueSet, BitSet, HashSet, ListSet, Set.EmptySet, Set.Set1, Set.Set2, Set.Set3, Set.Set4, SetProxy, SortedSet

Method Summary
override def companion : GenericCompanion[Set]
The factory companion object that builds instances of class CC
Methods inherited from SetLike
contains (abstract), + (abstract), - (abstract), newBuilder, isEmpty, apply, intersect, &, **, union, |, diff, &~, subsetOf, stringPrefix, toString, hashCode, equals
Methods inherited from Subtractable
-, --, --
Methods inherited from Addable
+, ++, ++
Methods inherited from GenericSetTemplate
empty
Methods inherited from Function1
compose, andThen
Methods inherited from IterableLike
iterator (abstract), thisCollection, toCollection, elements, foreach, forall, exists, find, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, size, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, withFilter
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def companion : GenericCompanion[Set]
The factory companion object that builds instances of class CC
Overrides
Iterable.companion, Set.companion