AvlMap

class AvlMap[K, V](val set: AvlSet[(K, V)])

A tree based immutable map.

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

Value members

Concrete methods

def +(kv: (K, V))(implicit K: Order[K]): AvlMap[K, V]

Add a key value pair to the map. O(log n)

Add a key value pair to the map. O(log n)

Source:
Map.scala
def ++(other: AvlMap[K, V])(implicit K: Order[K]): AvlMap[K, V]

Merge this map with another map. O(n log n)

Merge this map with another map. O(n log n)

Source:
Map.scala
def alter(k: K)(f: Option[V] => Option[V])(implicit K: Order[K]): AvlMap[K, V]

Convenience function for updating or removing a mapping for a key, where the mapping may or may not preexist. O(log n + log n). Current implementation has constant factors which are unnecessary and may be improved in future.

Convenience function for updating or removing a mapping for a key, where the mapping may or may not preexist. O(log n + log n). Current implementation has constant factors which are unnecessary and may be improved in future.

Source:
Map.scala
def containsKey(key: K)(implicit K: Order[K]): Boolean

Check if we have the given key in the map. O(log n)

Check if we have the given key in the map. O(log n)

Source:
Map.scala
def flatMap[B](f: V => AvlMap[K, B])(implicit K: Order[K]): AvlMap[K, B]

Map a function on all the values in the map.

Map a function on all the values in the map.

Source:
Map.scala
def foldLeft[B](b: B)(f: (B, (K, V)) => B): B

Fold across all the key/value pairs, associating minimum keys first.

Fold across all the key/value pairs, associating minimum keys first.

Source:
Map.scala
def foldRight[B](b: Eval[B])(f: ((K, V), Eval[B]) => Eval[B]): Eval[B]

Fold across all the key/value pairs, associating maximum keys first.

Fold across all the key/value pairs, associating maximum keys first.

Source:
Map.scala
def get(key: K)(implicit K: Order[K]): Option[V]

Get the value for the given key, if it exists. O(log n)

Get the value for the given key, if it exists. O(log n)

Source:
Map.scala
def map[B](f: V => B)(implicit K: Order[K]): AvlMap[K, B]

Map a function on all the values in the map.

Map a function on all the values in the map.

Source:
Map.scala
def remove(key: K)(implicit K: Order[K]): AvlMap[K, V]

Return a map which doesn't contain the given key. O(log n)

Return a map which doesn't contain the given key. O(log n)

Source:
Map.scala
def toList: List[(K, V)]

Return a list of Key,Value pairs O(N)

Return a list of Key,Value pairs O(N)

Source:
Map.scala
def toScalaMap: Map[K, V]

Return a scala.collection.immutable.Map

Return a scala.collection.immutable.Map

Source:
Map.scala
def updateAppend(key: K, value: V)(implicit K: Order[K], V: Semigroup[V]): AvlMap[K, V]

Update this map with the given key,value, if the Key is already present, the value is combined with the already present value using the provided Semigroup. O(log n)

Update this map with the given key,value, if the Key is already present, the value is combined with the already present value using the provided Semigroup. O(log n)

Source:
Map.scala

Concrete fields

val set: AvlSet[(K, V)]
Source:
Map.scala