MutableSet

dotty.tools.dotc.util.MutableSet
abstract class MutableSet[T] extends ReadOnlySet[T]

A common class for lightweight mutable sets.

Attributes

Graph
Supertypes
class ReadOnlySet[T]
class Object
trait Matchable
class Any
Known subtypes
class GenericHashSet[T]
class EqHashSet[T]
class HashSet[T]
class WeakHashSet[A]
class Uniques
Show all

Members list

Value members

Abstract 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 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

Concrete methods

def ++=(xs: IterableOnce[T]): Unit
def --=(xs: IterableOnce[T]): Unit
def add(x: T): Boolean

attempts to put x in the Set, if it was not entered before, return true, else return false. Overridden in GenericHashSet.

attempts to put x in the Set, if it was not entered before, return true, else return false. Overridden in GenericHashSet.

Attributes

Inherited methods

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 iterator: Iterator[T]

Attributes

Inherited from:
ReadOnlySet
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

Inherited from:
ReadOnlySet
def size: Int

Attributes

Inherited from:
ReadOnlySet
def toList: List[T]

Attributes

Inherited from:
ReadOnlySet