AvlSet

cats.collections.AvlSet
See theAvlSet companion object
sealed abstract class AvlSet[A]

An immutable, ordered, extensional set

This data-structure maintains balance using the [AVL](https://en.wikipedia.org/wiki/AVL_tree) algorithm.

Attributes

Companion
object
Source
Set.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def isEmpty: Boolean

Returns true if the Set is the empty Set.

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

Attributes

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.

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

Attributes

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.

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

Attributes

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.

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

Attributes

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)

Attributes

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.

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

Attributes

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

Returns true if the given element is in the set.

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

Attributes

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)

Attributes

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

Find the minimum element matching the given predicate.

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

Attributes

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

Attributes

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.

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

Attributes

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.

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

Attributes

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)

Attributes

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.

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

Attributes

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

Attributes

Source
Set.scala
def max: Option[A]

Returns None if the set is empty, otherwise returns the maximum element.

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

Attributes

Source
Set.scala
def min: Option[A]

Returns None if the set is empty, otherwise returns the minimum element.

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

Attributes

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

Attributes

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

Return a set which does not contain the given element.

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

Attributes

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)

Attributes

Source
Set.scala
def toIterator: Iterator[A]

Attributes

Source
Set.scala
def toList: List[A]

Return the sorted list of elements.

Return the sorted list of elements. O(n)

Attributes

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)

Attributes

Source
Set.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

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.

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

Attributes

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.

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

Attributes

Source
Set.scala

Abstract fields

val size: Int

The number of items in the Set.

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

Attributes

Source
Set.scala