AvlSet

sealed abstract class AvlSet[A]

An immutable, ordered, extensional set

This data-structure maintains balance using the AVL algorithm.

Companion:
object
Source:
Set.scala
class Object
trait Matchable
class Any

Value members

Abstract methods

Returns true if the Set is the empty Set. O(1)

Returns true if the Set is the empty Set. O(1)

Source:
Set.scala

Concrete methods

def &(another: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set containing the intersection of elements with this set and the given set. O(n log n)

Return a set containing the intersection of elements with this set and the given set. O(n log n)

Source:
Set.scala
def +(x: A)(implicit order: Order[A]): AvlSet[A]

Add's the given element to the set if it is not already present. O(log n)

Add's the given element to the set if it is not already present. O(log n)

Source:
Set.scala
def ++(another: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set containing the union of elements with this set and the given set. O(n log n)

Return a set containing the union of elements with this set and the given set. O(n log n)

Source:
Set.scala
def -(removals: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set that has any elements appearing in the removals set removed O(n log n)

Return a set that has any elements appearing in the removals set removed O(n log n)

Source:
Set.scala
def add(x: A)(implicit order: Order[A]): Branch[A]

Add's the given element to the set if it is not already present. O(log n)

Add's the given element to the set if it is not already present. O(log n)

Source:
Set.scala
def contains(x: A)(implicit order: Order[A]): Boolean

Returns true if the given element is in the set. O(log n)

Returns true if the given element is in the set. O(log n)

Source:
Set.scala
def diff(removals: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set that has any elements appearing in the removals set removed O(n log n)

Return a set that has any elements appearing in the removals set removed O(n log n)

Source:
Set.scala
def find(pred: A => Boolean): Option[A]

Find the minimum element matching the given predicate. Returns None if there is no element matching the predicate. O(log n)

Find the minimum element matching the given predicate. Returns None if there is no element matching the predicate. O(log n)

Source:
Set.scala
def flatMap[B : Order](f: A => AvlSet[B]): AvlSet[B]

Map a function on all values of the set

Map a function on all values of the set

Source:
Set.scala
def foldLeft[B](z: B)(f: (B, A) => B): B

fold the elements together from min to max, using the passed seed, and accumulator function. O(n)

fold the elements together from min to max, using the passed seed, and accumulator function. O(n)

Source:
Set.scala
def foldRight[B](z: Eval[B])(f: (A, Eval[B]) => Eval[B]): Eval[B]

fold the elements together from min to max, using the passed seed, and accumulator function. O(n)

fold the elements together from min to max, using the passed seed, and accumulator function. O(n)

Source:
Set.scala
def foreach(f: A => Unit): Unit

Applies a function to each element, in ascending order O(n)

Applies a function to each element, in ascending order O(n)

Source:
Set.scala
def intersect(another: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set containing the intersection of elements with this set and the given set. O(n log n)

Return a set containing the intersection of elements with this set and the given set. O(n log n)

Source:
Set.scala
def map[B : Order](f: A => B): AvlSet[B]

Map a function on all values of the set

Map a function on all values of the set

Source:
Set.scala
def max: Option[A]

Returns None if the set is empty, otherwise returns the maximum element. O(log n)

Returns None if the set is empty, otherwise returns the maximum element. O(log n)

Source:
Set.scala
def min: Option[A]

Returns None if the set is empty, otherwise returns the minimum element. O(log n)

Returns None if the set is empty, otherwise returns the minimum element. O(log n)

Source:
Set.scala
def predicate(implicit order: Order[A]): Predicate[A]

Return an Predicate with the same members as this set

Return an Predicate with the same members as this set

Source:
Set.scala
def remove(x: A)(implicit order: Order[A]): AvlSet[A]

Return a set which does not contain the given element. O(log n)

Return a set which does not contain the given element. O(log n)

Source:
Set.scala
def to[Col[_]](implicit cbf: Factory[A, Col[A]]): Col[A]

Converts this set into a Scala collection O(n)

Converts this set into a Scala collection O(n)

Source:
Set.scala
def toList: List[A]

Return the sorted list of elements. O(n)

Return the sorted list of elements. O(n)

Source:
Set.scala
def toScalaSet: Set[A]

Return a Scala set containing the elements in the set O(n)

Return a Scala set containing the elements in the set O(n)

Source:
Set.scala
override def toString: String
Definition Classes
Any
Source:
Set.scala
def union(another: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set containing the union of elements with this set and the given set. O(n log n)

Return a set containing the union of elements with this set and the given set. O(n log n)

Source:
Set.scala
def |(another: AvlSet[A])(implicit order: Order[A]): AvlSet[A]

Return a set containing the union of elements with this set and the given set. O(n log n)

Return a set containing the union of elements with this set and the given set. O(n log n)

Source:
Set.scala

Abstract fields

val size: Int

The number of items in the Set. O(1)

The number of items in the Set. O(1)

Source:
Set.scala