Scala Library Documentation
|
|
scala/collection/jcl/Set.scala
]
trait
Set[A]
extends
Collection[A] with
Set[A]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 |
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 |
elems
to the set.elems -
the iterable object containing the elements to be addedelems
from the set.elems -
An iterable object containing the elements to remove from the set.elem -
the element to be addedelem -
the element to be removedretain removes all elements from the set for
which the predicate p
yields the value false
.
override
def
isEmpty : Boolean
true
iff there is no element in the set.elem
.elem -
the element to check for membership.true
iff elem
is contained in this set.override
def
clear : Unit
that
.that -
another set.true
iff the other set is a superset of this set.
todo: rename to isSubsetOff
.f -
true
if the collection is actually updated.override
def
projection : Projection
filter
,
map
, and flatMap
methods that build projections
of the collection.
Scala Library Documentation
|
|