scala.collection.jcl

trait Set

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

trait Set[A]
extends Set[A] with Collection[A]
Analogous to a Java set.
Author
Sean McDirmid
Direct Known Subclasses:
Map.KeySet, Set.Projection, SetWrapper, SortedSet

Method Summary
override def + (t : A) : Set[A]
adds "a" from the collection. Useful for chaining.
override def ++ (i : Iterable[A]) : Set[A]
Operator shortcut for addAll.
override def - (t : A) : Set[A]
override def -- (i : Iterable[A]) : Set[A]
Operator shortcut for removeAll.
override abstract def add (a : A) : Boolean
Add will return false if "a" already exists in the set.
override def clear : Unit
clear all elements from the collection.
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[A]
returns a projection that can be used to call non-strict filter, map, and flatMap methods that build projections of the collection.
override final 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 Collection
hasAll, addAll, -=, +=
Methods inherited from MutableIterable
elements (abstract), has, remove, removeAll, retainOnly, retainAll, size0
Methods inherited from Set
update, +=, ++=, ++=, +, ++, incl, -=, --=, --=, -, --, excl, intersect, <<, clone, readOnly
Methods inherited from Set
size (abstract), apply, *, **, equals, hashCode, toArray, stringPrefix
Methods inherited from Collection
toString
Methods inherited from Iterable
concat, ++, map, flatMap, filter, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, hasDefiniteSize
Methods inherited from Function1
compose, andThen
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
class Filter (pp : (A) => Boolean) extends Filter with Projection[A]
Method Details
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 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[A]
Operator shortcut for addAll.
Overrides
Set.++, Collection.++

override def --(i : Iterable[A]) : Set[A]
Operator shortcut for removeAll.
Overrides
Set.--

override def +(t : A) : Set[A]
adds "a" from the collection. Useful for chaining.
Overrides
Set.+, Collection.+

override def -(t : A) : Set[A]
Returns
the collection that t was removed from.
Overrides
Set.-

override final 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 def clear : Unit
clear all elements from the collection.
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[A]
returns a projection that can be used to call non-strict filter, map, and flatMap methods that build projections of the collection.
Overrides
Collection.projection