in scala.collection
trait Set

`abstract trait` Set [A]
  `extends` java.lang.Object
  `with` (A) => scala.Boolean
  `with` scala.Iterable[A]
  `with` scala.ScalaObject

  This class defines the interface of collections that do not contain duplicate elements.

  Class `Set` may only be used for accessing elements from set implementations. Two different extensions of class `Set` in the package `scala.collection.mutable` and `scala.collection.immutable` provide functionality for adding new elements to a set. The class in the first package is implemented by sets the are modified destructively, whereas the class in the second package is used by functional set implementations that rely on immutable data structures.

Author:
  Matthias Zenger
Author:
  Martin Odersky
Version:
  2.0, 01/01/2007

Direct Known Subclasses:
  Set, Set, SetProxy, BitSet

Def Summary
| `def` apply (elem: A) : scala.Boolean This method allows sets to be interpreted as predicates. It returns `true`, iff this set contains element `elem`.
`abstract` | `def` contains (elem: A) : scala.Boolean Checks if this set contains element `elem`.
`override` | `def` equals (that: scala.Any) : scala.Boolean Compares this set with another object and returns true, iff the other object is also a set which contains the same elements as this set.
`override` | `def` hashCode : scala.Int hashcode for this set
| `def` isEmpty : scala.Boolean Checks if this set is empty.
`abstract` | `def` size : scala.Int Returns the number of elements in this set.
| `def` subsetOf (that: scala.collection.Set[A]) : scala.Boolean Checks if this set is a subset of set `that`.
`override` | `def` toString : java.lang.String Returns a string representation of this set.

Def inherited from (A) => scala.Boolean
andThen , apply, compose, toString

Def inherited from scala.Iterable[A]
++ , /:, :\, addString, concat, copyToBuffer, drop, dropWhile, elements, exists, filter, find, findIndexOf, flatMap, foldLeft, foldRight, forall, foreach, indexOf, map, mkString, mkString, reduceLeft, reduceRight, sameElements, take, takeWhile, toList

Def Detail

`def` apply (elem: A): scala.Boolean

  This method allows sets to be interpreted as predicates. It returns `true`, iff this set contains element `elem`.

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

`abstract def` contains (elem: A): scala.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` equals (that: scala.Any): scala.Boolean

  Compares this set with another object and returns true, iff the other object is also a set which contains the same elements as this set.

Parameters:
  `that -` the other object
Returns:
  `true` iff this set and the other set contain the same elements.

`override def` hashCode : scala.Int

  hashcode for this set

`def` isEmpty : scala.Boolean

  Checks if this set is empty.

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

`abstract def` size : scala.Int

  Returns the number of elements in this set.

Returns:
  number of set elements.

`def` subsetOf (that: scala.collection.Set[A]): scala.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` toString : java.lang.String

  Returns a string representation of this set.

Returns:
  a string showing all elements of this set.