in scala/collection/mutable
class HashSet

class HashSet[A]()
extends Set[A]
with ScalaObject
with HashTable[A]

This class implements mutable sets using a hashtable.
Author:
Matthias Zenger
Version:
1.0, 08/07/2003

Field Summary
protected type Entry

Method Summary
  def +=(elem: A): Unit
     This method adds a new element to the set.
  def -=(elem: A): Unit
     -= can be used to remove a single element from a set.
  def clear: Unit
     Removes all elements from the set.
override def clone(): HashSet[A]
     Return a clone of this set.
  def contains(elem: A): Boolean
     Checks if this set contains element elem.
  def elements: Iterator[A]
     Creates a new iterator over all elements contained in this object.
protected def entryKey(e: A): A

Methods inherited from java/lang/Object-class
eq, finalize, getClass, ne, notify, notifyAll, synchronized, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/Iterable-class
/:, :\, concat, exists, find, foldLeft, foldRight, forall, foreach, sameElements

Methods inherited from scala/ScalaObject-class
getScalaType

Methods inherited from scala/collection/Set-class
apply, equals, isEmpty, subsetOf, toList, toString

Methods inherited from scala/collection/mutable/HashTable-class
addEntry, elemEquals, elemHashCode, entries, findEntry, improve, index, initTable, initialSize, initialThreshold, loadFactor, removeEntry, size, table, tableSize, threshold

Methods inherited from scala/collection/mutable/Set-class
++=, ++=, --=, --=, <<, excl, filter, hashCode, incl, intersect, update

Field Detail

Entry

  protected type Entry = A
Method Detail

contains

  def contains(elem: A): Boolean
Checks if this set contains element elem.
Parameters:
elem - the element to check for membership.
Returns:
true, iff elem is contained in this set.

+=

  def +=(elem: A): Unit
This method adds a new element to the set.

-=

  def -=(elem: A): Unit
-= can be used to remove a single element from a set.

elements

  def elements: Iterator[A]
Creates a new iterator over all elements contained in this object.
Returns:
the new iterator

clear

  def clear: Unit
Removes all elements from the set. After this operation is completed, the set will be empty.

entryKey

  protected def entryKey(e: A): A

clone

  override def clone(): HashSet[A]
Return a clone of this set.
Returns:
a set with the same elements.