Map

trait Map[T <: Exec[T], A, B] extends SkipList[T, A, (A, B)]
Companion:
object
trait SkipList[T, A, (A, B)]
trait Mutable[T]
trait Disposable[T]
trait Writable
trait Identified[T]
class Object
trait Matchable
class Any
trait Map[T, A, B]

Value members

Abstract methods

def get(key: A)(implicit tx: T): Option[B]

Queries the value for a given key.

Queries the value for a given key.

Value parameters:
key

the key to look for

Returns:

the value if it was found at the key, otherwise None

def getOrElse[B1 >: B](key: A, default: => B1)(implicit tx: T): B1
def getOrElseUpdate(key: A, op: => B)(implicit tx: T): B
def keysIterator(implicit tx: T): Iterator[A]
def put(key: A, value: B)(implicit tx: T): Option[B]

Inserts a new entry into the map.

Inserts a new entry into the map.

Value parameters:
key

the entry's key to insert

value

the entry's value to insert

Returns:

the previous value stored at the key, or None if the key was not in the map

def remove(key: A)(implicit tx: T): Option[B]

Removes an entry from the map.

Removes an entry from the map.

Value parameters:
key

the key to remove

Returns:

the removed value which had been stored at the key, or None if the key was not in the map

def valuesIterator(implicit tx: T): Iterator[B]

Inherited methods

def +=(entry: (A, B))(implicit tx: T): Map[T, A, B]
Inherited from:
SkipList
def -=(key: A)(implicit tx: T): Map[T, A, B]
Inherited from:
SkipList
def ceil(key: A)(implicit tx: T): Option[(A, B)]

Finds the entry with the smallest key which is greater than or equal to the search key.

Finds the entry with the smallest key which is greater than or equal to the search key.

Value parameters:
key

the search key

Returns:

the found entry, or None if there is no key greater than or equal to the search key (e.g. the list is empty)

Inherited from:
SkipList
def clear()(implicit tx: T): Unit
Inherited from:
SkipList
def contains(key: A)(implicit tx: T): Boolean

Searches for the Branch of a given key.

Searches for the Branch of a given key.

Value parameters:
key

the key to search for

Returns:

true if the key is in the list, false otherwise

Inherited from:
SkipList
def debugPrint()(implicit tx: T): String
Inherited from:
SkipList
def dispose()(implicit tx: T): Unit
Inherited from:
Disposable
override def equals(that: Any): Boolean
Definition Classes
Identified -> Any
Inherited from:
Identified
def firstKey(implicit tx: T): A
Inherited from:
SkipList
def floor(key: A)(implicit tx: T): Option[(A, B)]

Finds the entry with the largest key which is smaller than or equal to the search key.

Finds the entry with the largest key which is smaller than or equal to the search key.

Value parameters:
key

the search key

Returns:

the found entry, or None if there is no key smaller than or equal to the search key (e.g. the list is empty)

Inherited from:
SkipList
override def hashCode: Int
Definition Classes
Identified -> Any
Inherited from:
Identified
def head(implicit tx: T): (A, B)

Returns the first element. Throws an exception if the list is empty.

Returns the first element. Throws an exception if the list is empty.

Inherited from:
SkipList
def headOption(implicit tx: T): Option[(A, B)]

Returns the first element, or None if the list is empty.

Returns the first element, or None if the list is empty.

Inherited from:
SkipList
def height(implicit tx: T): Int

The number of levels in the skip list.

The number of levels in the skip list.

Inherited from:
SkipList
def id: Ident[T]
Inherited from:
Identified
def isEmpty(implicit tx: T): Boolean
Inherited from:
SkipList
def isomorphicQuery(compare: A => Int)(implicit tx: T): ((A, B), Int)

Finds the nearest item equal or greater than an unknown item from an isomorphic set. The isomorphism is represented by a comparison function which guides the binary search.

Finds the nearest item equal or greater than an unknown item from an isomorphic set. The isomorphism is represented by a comparison function which guides the binary search.

Value parameters:
compare

a function that guides the search. should return -1 if the argument is smaller than the search key, 0 if both are equivalent, or 1 if the argument is greater than the search key. E.g., using some mapping, the function could look like mapping.apply(_).compare(queryKey)

Returns:

the nearest item, or the maximum item

Inherited from:
SkipList
def iterator(implicit tx: T): Iterator[(A, B)]
Inherited from:
SkipList
def keyFormat: TFormat[T, A]
Inherited from:
SkipList
def last(implicit tx: T): (A, B)

Returns the last element. Throws an exception if the list is empty.

Returns the last element. Throws an exception if the list is empty.

Inherited from:
SkipList
def lastKey(implicit tx: T): A
Inherited from:
SkipList
def lastOption(implicit tx: T): Option[(A, B)]

Returns the last element, or None if the list is empty.

Returns the last element, or None if the list is empty.

Inherited from:
SkipList
def maxGap: Int

The maximum gap within elements of each skip level.

The maximum gap within elements of each skip level.

Inherited from:
SkipList
def minGap: Int

The minimum gap within elements of each skip level.

The minimum gap within elements of each skip level.

Inherited from:
SkipList
def nonEmpty(implicit tx: T): Boolean
Inherited from:
SkipList
def size(implicit tx: T): Int

Reports the number of keys in the skip list (size of the bottom level). This operation may take up to O(n) time, depending on the implementation.

Reports the number of keys in the skip list (size of the bottom level). This operation may take up to O(n) time, depending on the implementation.

Inherited from:
SkipList
def toIndexedSeq(implicit tx: T): IndexedSeq[(A, B)]
Inherited from:
SkipList
def toList(implicit tx: T): List[(A, B)]
Inherited from:
SkipList
def toSeq(implicit tx: T): Seq[(A, B)]
Inherited from:
SkipList
def toSet(implicit tx: T): Set[(A, B)]
Inherited from:
SkipList
def write(out: DataOutput): Unit
Inherited from:
Writable

Implicits

Inherited implicits

implicit def ordering: TOrdering[T, A]

The ordering used for the keys of this list.

The ordering used for the keys of this list.

Inherited from:
SkipList