final class HashSet[A] extends Set[A] with SetLike[A, HashSet] with Buildable[A, HashSet[A]] with Builder[A, HashSet[A]]
Mutable set backed by a hash trie
- Alphabetic
- By Inheritance
- HashSet
- Builder
- Buildable
- Set
- Growable
- SetLike
- SetMonoTransforms
- Set
- SetLike
- Equals
- SetMonoTransforms
- Iterable
- IterableLike
- IterablePolyTransforms
- IterableMonoTransforms
- IterableOps
- FromIterable
- IterableOnce
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new HashSet()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
&(that: collection.Set[A]): HashSet[A]
- Definition Classes
- HashSet → SetMonoTransforms
-
def
++(that: collection.Set[A]): HashSet[A]
- Definition Classes
- HashSet → SetMonoTransforms
-
def
++[B >: A](xs: IterableOnce[B]): HashSet[B]
Concatenation
Concatenation
- Definition Classes
- IterablePolyTransforms
-
def
++=(xs: IterableOnce[A]): HashSet.this.type
${Add}s all elements produced by a TraversableOnce to this $coll.
${Add}s all elements produced by a TraversableOnce to this $coll.
- xs
the TraversableOnce producing the elements to $add.
- returns
the $coll itself.
- Definition Classes
- Growable
-
def
+=(elem: A): HashSet.this.type
Append an element
-
def
+=(elem1: A, elem2: A, elems: A*): HashSet.this.type
${Add}s two or more elements to this $coll.
${Add}s two or more elements to this $coll.
- elem1
the first element to $add.
- elem2
the second element to $add.
- elems
the remaining elements to $add.
- returns
the $coll itself
- Definition Classes
- Growable
- def -=(elem: A): HashSet.this.type
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canEqual(that: Any): Boolean
- Definition Classes
- SetLike → Equals
-
def
className: String
The class name of this collection.
The class name of this collection. To be used for converting to string. Collections generally print like this:
<className>(elem_1, ..., elem_n)
- Definition Classes
- IterableOps
-
def
clear(): Unit
Clears the contents of this builder.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
coll: HashSet.this.type
The collection itself
The collection itself
- Attributes
- protected
- Definition Classes
- Iterable → IterablePolyTransforms → IterableMonoTransforms → IterableOps
- def contains(elem: A): Boolean
-
def
copyToArray[B >: A](xs: Array[B], start: Int = 0): xs.type
Copy all elements of this collection to array
xs, starting atstart.Copy all elements of this collection to array
xs, starting atstart.- Definition Classes
- IterableOps
-
def
drop(n: Int): HashSet[A @scala.annotation.unchecked.uncheckedVariance]
The rest of the collection without its
nfirst elements.The rest of the collection without its
nfirst elements. For linear, immutable collections this should avoid making a copy.- Definition Classes
- IterableMonoTransforms
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
- Definition Classes
- SetLike → Equals → AnyRef → Any
-
def
filter(p: (A) ⇒ Boolean): HashSet[A @scala.annotation.unchecked.uncheckedVariance]
All elements satisfying predicate
pAll elements satisfying predicate
p- Definition Classes
- IterableMonoTransforms
-
def
filterInPlace(p: (A) ⇒ Boolean): Unit
- Definition Classes
- Set
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (A) ⇒ IterableOnce[B]): HashSet[B]
Flatmap
Flatmap
- Definition Classes
- IterablePolyTransforms
-
def
flatMapInPlace(f: (A) ⇒ IterableOnce[A]): Unit
- Definition Classes
- Set
-
def
foldLeft[B](z: B)(op: (B, A) ⇒ B): B
Fold left
Fold left
- Definition Classes
- IterableOps
-
def
foldRight[B](z: B)(op: (A, B) ⇒ B): B
Fold right
Fold right
- Definition Classes
- IterableOps
-
def
foreach[U](f: (A) ⇒ U): Unit
Apply
fto each element for its side effects Note: [U] parameter needed to help scalac's type inference.Apply
fto each element for its side effects Note: [U] parameter needed to help scalac's type inference.- Definition Classes
- IterableOps
-
def
fromIterable[B](coll: collection.Iterable[B]): HashSet[B]
- Definition Classes
- HashSet → IterablePolyTransforms → FromIterable
-
def
fromIterableWithSameElemType(coll: collection.Iterable[A]): HashSet[A]
Create a collection of type
C[A]from the elements ofcoll, which has the same element type as this collection.Create a collection of type
C[A]from the elements ofcoll, which has the same element type as this collection. Overridden in StringOps and ArrayOps.- Attributes
- protected[this]
- Definition Classes
- HashSet → IterableLike → IterableMonoTransforms
- def get(elem: A): Option[A]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- SetLike → AnyRef → Any
-
def
head: A
The first element of the collection.
The first element of the collection.
- Definition Classes
- IterableOps
-
def
indexWhere(p: (A) ⇒ Boolean): Int
The index of the first element in this collection for which
pholds.The index of the first element in this collection for which
pholds.- Definition Classes
- IterableOps
-
def
insert(elem: A): Boolean
- Definition Classes
- Set
-
def
isEmpty: Boolean
Is the collection empty?
Is the collection empty?
- Definition Classes
- IterableOps
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterator(): Iterator[A]
Iterator can be used only once
Iterator can be used only once
- Definition Classes
- HashSet → IterableOnce
-
def
knownSize: Int
The number of elements in this collection, if it can be cheaply computed, -1 otherwise.
The number of elements in this collection, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.
- Definition Classes
- IterableOps
-
def
map[B](f: (A) ⇒ B): HashSet[B]
Map
Map
- Definition Classes
- IterablePolyTransforms
-
def
mapInPlace(f: (A) ⇒ A): Unit
- Definition Classes
- Set
-
def
mapResult[NewTo](f: (HashSet[A]) ⇒ NewTo): Builder[A, NewTo]
A builder resulting from this builder my mapping the result using
f.A builder resulting from this builder my mapping the result using
f.- Definition Classes
- Builder
-
def
mkString(sep: String): String
A string showing all elements of this collection, separated by string
sep.A string showing all elements of this collection, separated by string
sep.- Definition Classes
- IterableOps
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newBuilder: Builder[A, HashSet[A]]
Creates a new builder.
-
def
nonEmpty: Boolean
Is the collection not empty?
Is the collection not empty?
- Definition Classes
- IterableOps
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
partition(p: (A) ⇒ Boolean): (HashSet[A], HashSet[A])
Optimized, push-based version of
partition.Optimized, push-based version of
partition.- Definition Classes
- Buildable → IterableMonoTransforms
-
def
remove(elem: A): Option[A]
- Definition Classes
- Set
-
def
result: HashSet[A]
Result collection consisting of all elements appended so far.
-
def
size: Int
The number of elements in this collection.
The number of elements in this collection. Does not terminate for infinite collections.
- Definition Classes
- IterableOps
- def subsetOf(that: collection.Set[A]): Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tail: HashSet[A @scala.annotation.unchecked.uncheckedVariance]
The rest of the collection without its first element.
The rest of the collection without its first element.
- Definition Classes
- IterableMonoTransforms
-
def
take(n: Int): HashSet[A @scala.annotation.unchecked.uncheckedVariance]
A collection containing the first
nelements of this collection.A collection containing the first
nelements of this collection.- Definition Classes
- IterableMonoTransforms
-
def
to[C[X] <: collection.Iterable[X]](fi: FromIterable[C]): C[A]
Given a collection factory
fifor collections of type constructorC, convert this collection to one of typeC[A].Given a collection factory
fifor collections of type constructorC, convert this collection to one of typeC[A]. Example uses:xs.to(List) xs.to(ArrayBuffer)
- Definition Classes
- IterableOps
-
def
toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]
Convert collection to array.
Convert collection to array.
- Definition Classes
- IterableOps
-
def
toString(): String
- Definition Classes
- IterableOps → Any
-
def
view: View[A]
A view representing the elements of this collection.
A view representing the elements of this collection.
- Definition Classes
- IterableOps
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
zip[B](xs: IterableOnce[B]): HashSet[(A, B)]
Zip.
Zip. Interesting because it requires to align to source collections.
- Definition Classes
- IterablePolyTransforms