scala.collection.jcl
trait Set

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

`` `trait` Set[A]
  `extends` Collection[A]`with` Set[A]

  Analogous to a Java set.

Author
  Sean McDirmid

Direct Known Subclasses:
  Map.KeySet, Set.Filter, SetWrapper, SortedSet

Method Summary
`override def` | + (t : A) : Set Add a new element to the set.
`override def` | ++ (i : Iterable[A]) : Set Add all the elements provided by an iterator of the iterable object `elems` to the set.
`override def` | - (t : A) : Set Remove a new element from the set.
`override def` | -- (i : Iterable[A]) : Set Remove all the elements provided by an iterator of the iterable object `elems` from the set.
`override abstract def` | add (a : A) : Boolean Add will return false if "a" already exists in the set.
`override def` | clear : Unit Removes all elements from the set. After this operation is completed, the set will be empty.
`override final def` | contains (a : A) : Boolean Checks if this set contains element `elem`.
`override def` | isEmpty : Boolean Checks if this set is empty.
`override def` | projection : Projection returns a facade that can be used to call non-strict `filter`, `map`, and `flatMap` methods that build projections of the collection.
`override def` | retain (f : (A) => Boolean) : Unit Method `retain removes all elements from the set for which the predicate `p` yields the value `false`.`
`override def` | subsetOf (set : Set[A]) : Boolean Checks if this set is a subset of set `that`.
`override def` | transform (f : (A) => A) : Boolean Transforms each element of the collection in-place according to `f`.

Methods inherited from Set
update, +=, ++=, ++=, +, ++, incl, -=, --=, --=, -, --, excl, intersect, <<, clone, readOnly

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

Methods inherited from Function1
toString, compose, andThen

Methods inherited from Collection
hasAll, addAll, -=, +=

Methods inherited from MutableIterable
elements (abstract), has, remove, removeAll, retainAll, size0

Methods inherited from Collection
stringPrefix

Methods inherited from Iterable
concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, addString, addString, copyToArray, hasDefiniteSize

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

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

Class Summary
`class` | Filter (p : (A) => Boolean)`extends` Filter `with` Set[A] Base implementation of a filtered collection
`trait` | Projection `extends` Projection

Method Details

`override abstract` `def` add(a : A) : Boolean

  Add will return false if "a" already exists in the set.

Overrides
  Collection.add

`override` `def` ++(i : Iterable[A]) : Set

  Add all the elements provided by an iterator of the iterable object `elems` to the set.

Parameters
  `elems -` the iterable object containing the elements to be added
Returns
  the set itself with the elements added.

Overrides
  Collection.++, Set.++

`override` `def` --(i : Iterable[A]) : Set

  Remove all the elements provided by an iterator of the iterable object `elems` from the set.

Parameters
  `elems -` An iterable object containing the elements to remove from the set.
Returns
  the set itself with the elements removed.

Overrides
  Set.--

`override` `def` +(t : A) : Set

  Add a new element to the set.

Returns
  the set itself with the element added.
Parameters
  `elem -` the element to be added

Overrides
  Collection.+, Set.+

`override` `def` -(t : A) : Set

  Remove a new element from the set.

Returns
  the set itself with the element removed.
Parameters
  `elem -` the element to be removed

Overrides
  Set.-

`override` `def` retain(f : (A) => Boolean) : Unit

  Method `retain removes all elements from the set for which the predicate `p` yields the value `false`.`

Overrides
  Set.retain

`override` `def` isEmpty : Boolean

  Checks if this set is empty.

Returns
  `true` iff there is no element in the set.

`override final` `def` contains(a : A) : Boolean

  Checks if this set contains element `elem`.

Parameters
  `elem -` the element to check for membership.
Returns
  `true` iff `elem` is contained in this set.

`override` `def` clear : Unit

  Removes all elements from the set. After this operation is completed, the set will be empty.

Overrides
  Set.clear

`override` `def` subsetOf(set : Set[A]) : Boolean

  Checks if this set is a subset of set `that`.

Parameters
  `that -` another set.
Returns
  `true` iff the other set is a superset of this set. todo: rename to isSubsetOf

`override` `def` transform(f : (A) => A) : Boolean

  Transforms each element of the collection in-place according to `f`.

Parameters
  `f -`
Returns
  `true` if the collection is actually updated.

Overrides
  Collection.transform

`override` `def` projection : Projection

  returns a facade that can be used to call non-strict `filter`, `map`, and `flatMap` methods that build projections of the collection.

Overrides
  Collection.projection