BiMap

scalation.BiMap
class BiMap[K, V]

The BiMap class maps keys to values and values to keys.

Type parameters

K

the key type

V

the value type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def +=(kv: (K, V)): this.type
def apply(k: K): V

Given the a key 'k', return the most recent value it was entered with.

Given the a key 'k', return the most recent value it was entered with.

Value parameters

k

the key whose value is sought

Attributes

def contains(k: K): Boolean
def from(v: V): K

Given the a value 'v', return the most recent key it was entered with. If values are unqiue, keys and values will be one-to-one correspondence. Note, if all keys are needed should use a MultiMap.

Given the a value 'v', return the most recent key it was entered with. If values are unqiue, keys and values will be one-to-one correspondence. Note, if all keys are needed should use a MultiMap.

Value parameters

v

the value whose key is sought

Attributes

def put(kv: (K, V)): this.type

Put the (key, value) to the map.

Put the (key, value) to the map.

Value parameters

kv

the key-value pair

Attributes

def put(k: K, v: V): Option[V]