|
Scala Library
|
|
scala/collection/mutable/HashSet.scala]
class
HashSet[A]
extends Set[A] with GenericSetTemplate[A, HashSet] with SetLike[A, HashSet[A]] with FlatHashTable[A]| Values and Variables inherited from FlatHashTable | |
| table, tableSize, threshold |
| Method Summary | |
def
|
+=
(elem : A) : HashSet[A]
Adds a new element to the set.
|
def
|
-=
(elem : A) : HashSet[A]
Removes a single element from a set.
|
override def
|
add
(elem : A) : Boolean
Adds a new element to the set.
|
override def
|
clear
: Unit
Removes all elements from the set. After this operation is completed,
the set will be empty.
|
override def
|
clone
: Set[A]
This method creates and returns a copy of the receiver object.
|
override def
|
companion
: GenericCompanion[HashSet]
The factory companion object that builds instances of class CC
|
def
|
contains
(elem : A) : Boolean
Checks if this set contains element
elem. |
override def
|
foreach
[U](f : (A) => U) : Unit
Apply a function
f to all elements of this
iterable object. |
override def
|
remove
(elem : A) : Boolean
Removes a single element from a set.
|
override def
|
size
: Int
The number of elements in this collection
|
| Methods inherited from FlatHashTable | |
| loadFactor, loadFactorDenum, initialSize, findEntry, containsEntry, addEntry, removeEntry, iterator, elemHashCode, improve, index, clearTable |
| Methods inherited from SetLike | |
| newBuilder, update, retain, result, +, +, ++, ++, -, -, --, --, << |
| Methods inherited from Shrinkable | |
| -=, --=, --= |
| Methods inherited from Builder | |
| sizeHint, mapResult |
| Methods inherited from Growable | |
| +=, ++=, ++= |
| Methods inherited from SetLike | |
| isEmpty, apply, intersect, &, **, union, |, diff, &~, subsetOf, stringPrefix, toString, hashCode, equals |
| Methods inherited from GenericSetTemplate | |
| empty |
| Methods inherited from Function1 | |
| compose, andThen |
| 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 AnyRef | |
| getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
| Methods inherited from Any | |
| ==, !=, isInstanceOf, asInstanceOf |
| Method Details |
override
def
companion : GenericCompanion[HashSet]
override
def
size : Int
elem.elem - the element to check for membership.true iff elem is contained in this set.elem - the element to be addedelem - The element to be removed.elem - the element to be addedelem - The element to be removed.override
def
clear : Unit
f to all elements of this
iterable object.f - A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.
The default implementation of the clone method is platform dependent.
|
Scala Library
|
|