HashSet

dotty.tools.dotc.util.HashSet
See theHashSet companion object
class HashSet[T](initialCapacity: Int, capacityMultiple: Int) extends MutableSet[T]

A hash set that allows some privileged protected access to its internals

Value parameters

capacityMultiple

The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.

initialCapacity

Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given initialCapacity. Minimum value is 4.

Attributes

Companion
object
Graph
Supertypes
class MutableSet[T]
class ReadOnlySet[T]
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

abstract class EntryIterator extends Iterator[T]

Attributes

Supertypes
trait Iterator[T]
trait IterableOnce[T]
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def +=(x: T): Unit

Add element x to the set

Add element x to the set

Attributes

def -=(x: T): Unit

Remove element x from the set

Remove element x from the set

Attributes

def clear(resetToInitial: Boolean): Unit

Remove all elements from this set.

Remove all elements from this set.

Value parameters

resetToInitial

If true, set back to initial configuration, which includes reallocating tables.

Attributes

def copyFrom(oldTable: Array[AnyRef | Null]): Unit
def iterator: Iterator[T]
def lookup(x: T): T | Null

The entry in the set such that isEqual(x, entry), or else null.

The entry in the set such that isEqual(x, entry), or else null.

Attributes

def put(x: T): T

Like += but return existing element equal to x of it exists, x itself otherwise.

Like += but return existing element equal to x of it exists, x itself otherwise.

Attributes

def remove(x: T): Boolean
def size: Int

The number of elements in the set

The number of elements in the set

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

def ++=(xs: IterableOnce[T]): Unit

Attributes

Inherited from:
MutableSet
def --=(xs: IterableOnce[T]): Unit

Attributes

Inherited from:
MutableSet
def contains(x: T): Boolean

Attributes

Inherited from:
ReadOnlySet
def foreach[U](f: T => U): Unit

Attributes

Inherited from:
ReadOnlySet

Attributes

Inherited from:
ReadOnlySet
def toList: List[T]

Attributes

Inherited from:
ReadOnlySet