scala.collection.MapLike

class DefaultKeySet

[source: scala/collection/MapLike.scala]

protected class DefaultKeySet
extends Set[A]
Direct Known Subclasses:
SortedMapLike.DefaultKeySortedSet

Method Summary
def + (elem : A) : Set[A]
Creates a new set with an additional element, unless the element is already present.
def - (elem : A) : Set[A]
Creates a new set with given element removed from this set, unless the element is not present.
def contains (key : A) : Boolean
Checks if this set contains element elem.
override def foreach [C](f : (A) => C) : Unit
Apply a function f to all elements of this iterable object.
def iterator : Iterator[A]
Creates a new iterator over all elements contained in this iterable object.
override def size : Int
The number of elements in this collection
Methods inherited from Set
companion
Methods inherited from SetLike
newBuilder, isEmpty, apply, intersect, &, **, union, |, diff, &~, subsetOf, stringPrefix, toString, hashCode, equals
Methods inherited from Subtractable
-, --, --
Methods inherited from Addable
+, ++, ++
Methods inherited from GenericSetTemplate
empty
Methods inherited from IterableLike
thisCollection, toCollection, elements, forall, exists, find, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, view, view, first, firstOption, projection
Methods inherited from GenericTraversableTemplate
genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toSeq, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, withFilter
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
Method Details
def contains(key : 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.

def iterator : Iterator[A]
Creates a new iterator over all elements contained in this iterable object.
Returns
the new iterator

def +(elem : A) : Set[A]
Creates a new set with an additional element, unless the element is already present.
Parameters
elem - the element to be added

def -(elem : A) : Set[A]
Creates a new set with given element removed from this set, unless the element is not present.
Parameters
elem - the element to be removed

override def size : Int
The number of elements in this collection

override def foreach[C](f : (A) => C) : Unit
Apply a function f to all elements of this iterable object.
Parameters
f - A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.
Notes
This method underlies the implementation of most other bulk operations. Implementing `foreach` with `iterator` is often suboptimal. So `foreach` should be overridden in concrete collection classes if a more efficient implementation is available.