dotty.tools.dotc.util.MutableSet.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala3-compiler_3 Show documentation
Show all versions of scala3-compiler_3 Show documentation
scala3-compiler-bootstrapped
package dotty.tools.dotc.util
/** A common class for lightweight mutable sets.
*/
abstract class MutableSet[T] extends ReadOnlySet[T]:
/** Add element `x` to the set */
def +=(x: T): Unit
/** Like `+=` but return existing element equal to `x` of it exists,
* `x` itself otherwise.
*/
def put(x: T): T
/** Remove element `x` from the set */
def -=(x: T): Unit
/** Remove all elements from this set.
* @param resetToInitial If true, set back to initial configuration, which includes
* reallocating tables.
*/
def clear(resetToInitial: Boolean = true): Unit
def ++= (xs: IterableOnce[T]): Unit =
xs.iterator.foreach(this += _)
def --= (xs: IterableOnce[T]): Unit =
xs.iterator.foreach(this -= _)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy