scala.collection.mutable

class ImmutableSetAdaptor

[source: scala/collection/mutable/ImmutableSetAdaptor.scala]

@serializable

class ImmutableSetAdaptor[A](protected val set : Set[A])
extends Set[A]
This class can be used as an adaptor to create mutable sets from immutable set implementations. Only method empty has to be redefined if the immutable set on which this mutable set is originally based is not empty. empty is supposed to return the representation of an empty set.
Author
Matthias Zenger
Version
1.0, 21/07/2003
Method Summary
def += (elem : A) : Unit
Add a new element to the set.
def -= (elem : A) : Unit
Removes a single element from a set.
override def clear : Unit
Removes all elements from the set. After this operation is completed, the set will be empty.
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.
override def exists (p : (A) => Boolean) : Boolean
Apply a predicate p to all elements of this iterable object and return true, iff there is at least one element for which p yields true.
override def foreach (f : (A) => Unit) : Unit
Apply a function f to all elements of this iterable object.
override def isEmpty : Boolean
Checks if this set is empty.
def size : Int
Returns the number of elements in this set.
override def toList : List[A]
Create a fresh list with all the elements of this iterable object.
override def toString : String
Methods inherited from Set
update, +=, ++=, ++=, +, +, ++, ++, incl, -=, --=, --=, -, -, --, --, excl, intersect, retain, <<, clone, readOnly
Methods inherited from Set
apply, subsetOf, equals, hashCode, toArray
Methods inherited from Collection
stringPrefix
Methods inherited from Iterable
concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, forall, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toStream, mkString, mkString, mkString, addString, addString, copyToArray, projection, hasDefiniteSize
Methods inherited from Function1
compose, andThen
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf