scala.collection.immutable
trait Set

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

`` `trait` Set[A]
  `extends` Set[A]

  This class defines the interface for immutable sets. Operations on an immutable set leave the original set unchanged, and return a new set if needed.

  Concrete set implementations just have to provide functionality for the abstract methods in `scala.collection.Set` as well as for `+` and `-`.

  Note that abstract immutable.Set's are not covariant in their type parameter. This is because some implementations cannot support the `+` method for arbitrary types.

Author
  Matthias Zenger, Martin Odersky
Version
  1.1, 03/05/2004

Direct Known Subclasses:
  Enumeration.SetXX, EmptySet, HashSet, ListSet, Set1, Set2, Set3, Set4, SortedSet

Method Summary
`def` | ** (that : Set[A]) : Set[A] This method is an alias for `intersect`. It computes an intersection with set `that`. It removes all the elements that are not present in `that`.
`def` | + (elem1 : A, elem2 : A, elems : A*) : Set[A] Add two or more elements to this set.
`abstract def` | + (elem : A) : Set[A] Create a new set with an additional element.
`def` | ++ (elems : Iterator[A]) : Set[A] Add all the elements provided by an iterator to the set.
`def` | ++ (elems : Iterable[A]) : Set[A] Add all the elements provided by an iterator of the iterable object `elems` to the set.
`def` | - (elem1 : A, elem2 : A, elems : A*) : Set[A] Remove two or more elements from this set.
`abstract def` | - (elem : A) : Set[A] Remove a single element from a set.
`def` | -- (elems : Iterator[A]) : Set[A] Remove all the elements provided by an iterator `elems` from the set.
`def` | -- (elems : Iterable[A]) : Set[A] Remove all the elements provided by an iterator of the iterable object `elems` from the set.
`abstract def` | empty [B] : Set[B]
`def` | excl (that : Iterable[A]) : Set[A] This method removes all the elements provided by an iterator of the iterable object `that` from the set.
`def` | excl (elems : A*) : Set[A] `excl` removes many elements from the set.
`override def` | filter (p : (A) => Boolean) : Set[A] Method `filter` removes all elements from the set for which the predicate `p` yields the value `false`.
`override def` | flatMap [B](f : (A) => Iterable[B]) : Set[B] Applies the given function `f` to each element of this set, then forms the union of all results.
`def` | incl (elems : A*) : Set[A] `incl` can be used to add many elements to the set at the same time.
`def` | incl (that : Iterable[A]) : Set[A] This method will add all the elements provided by an iterator of the iterable object `that` to the set.
`def` | intersect (that : Set[A]) : Set[A] This method computes an intersection with set `that`. It removes all the elements that are not present in `that`.
`override def` | map [B](f : (A) => B) : Set[B] Returns the set resulting from applying the given function `f` to each element of this set.

Methods inherited from Set
size (abstract), contains (abstract), apply, isEmpty, subsetOf, equals, hashCode, toArray

Methods inherited from Collection
toString, stringPrefix

Methods inherited from Iterable
elements (abstract), concat, ++, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toStream, mkString, mkString, mkString, addString, addString, copyToArray, projection, hasDefiniteSize

Methods inherited from Function1
compose, andThen

Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf