scala.collection.immutable

class TreeSet

[source: scala/collection/immutable/TreeSet.scala]

@serializable

class TreeSet[A](val size : Int, t : Tree[Unit], implicit view$2 : (A) => Ordered[A])
extends RedBlack[A] with SortedSet[A]
This class implements immutable sets using a tree.
Author
Martin Odersky
Version
2.0, 02/01/2007
Additional Constructor Summary
def this ()(implicit view$3 : (A) => Ordered[A]) : TreeSet[A]
Value Summary
protected val tree : Tree[Unit]
Method Summary
def + (elem : A) : TreeSet[A]
A new TreeSet with the entry added is returned,
def - (elem : A) : TreeSet[A]
Remove a single element from a set.
override def compare (a0 : A, a1 : A) : Int
Comparison function that orders keys.
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.
def elementsSlow : Iterator[A]
def empty [B] : Set[B]
A factory to create empty maps of the same type of keys.
override def exists (f : (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 firstKey : A
Returns the first key of the collection.
override def forall (f : (A) => Boolean) : Boolean
Apply a predicate p to all elements of this iterable object and return true, iff the predicate yields true for all elements.
override def foreach (f : (A) => Unit) : Unit
Apply a function f to all elements of this iterable object.
def insert (elem : A) : TreeSet[A]
A new TreeSet with the entry added is returned, assuming that elem is not in the TreeSet.
def isSmaller (x : A, y : A) : Boolean
override def lastKey : A
Returns the last key of the collection.
override def rangeImpl (from : Option[A], until : Option[A]) : TreeSet[A]
Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Keys are garuanteed to be consistent between the collection and its projection.
Methods inherited from Set
+, ++, ++, incl, incl, -, --, --, excl, excl, intersect, **, map, flatMap, filter
Methods inherited from SortedSet
keySet, from, until, range, subsetOf
Methods inherited from Sorted
to, hasAll
Methods inherited from Set
apply, isEmpty, equals, hashCode, toArray
Methods inherited from Collection
toString, stringPrefix
Methods inherited from Iterable
concat, ++, takeWhile, dropWhile, take, drop, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toStream, mkString, mkString, mkString, addString, addString, copyToArray, projection, hasDefiniteSize
Methods inherited from Function1
compose, andThen
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf