Lookup.Mutable

trait Mutable[A, B] extends Lookup[A, B]

Mutable Lookup Collection

Mutable lookup collection provides methods to modify its content

Note. Lookup.Mutable does not extend Collection.Mutable, because it is impossible to reconsile update operations.

Source
__.scala
trait Lookup[Lookup.Mutable.A, Lookup.Mutable.B]
trait Collection[Lookup.Mutable.B]
trait Able.Size
trait Able.Stream[Lookup.Mutable.B]
class java.lang.Object
trait scala.Matchable
class Any
class Lookup.Mutable.X.Abstract[Lookup.Mutable.X.Abstract.A, Lookup.Mutable.X.Abstract.B]
class Lookup.Mutable.X.Concurrent[Lookup.Mutable.X.Concurrent.A, Lookup.Mutable.X.Concurrent.B]
class Lookup.Mutable.X.Basic[Lookup.Mutable.X.Basic.A, Lookup.Mutable.X.Basic.B]

Def

inline def ++=(s: Stream[(A, B)]): Lookup.M[A, B]

Alias for putAll

Alias for putAll

Source
__.scala
inline def +=(v: (A, B)): Lookup.M[A, B]

Alias for put

Alias for put

Source
__.scala
inline def --=(keys: Stream[A]): Lookup.M[A, B]

Alias for removeAll

Alias for removeAll

Source
__.scala
inline def -=(key: A): Lookup.M[A, B]

Alias for remove

Alias for remove

Source
__.scala
def clear: Unit

Make empty

Make empty

Discards all entries, collection size will become zero

Source
__.scala
def get(v: A): B

Element by key

Element by key

Returns element associated with the given key

Note. This operation will fail, if value is not found. Thus, use safer getOpt in most cases

Inherited from
Lookup
Source
__.scala
def getOpt(key: A): Opt[B]

Optional element by key

Optional element by key

Optionally returns element associated with the given key

Inherited from
Lookup
Source
__.scala
def getOrPut(key: A, v: => B): B

Get or create key/value association

Get or create key/value association

Returns existent value assisiated with the given key.

If the association does not exist, it will be created with the given default value, and then same value will be returned.

Source
__.scala
def getStream(keys: Stream[A]): Stream[B]

Multi key lookup

Multi key lookup

Returns a stream of values for given stream of keys.

Note: There may be less values, than keys. Keys with no assosiated values are ignored.

Inherited from
Lookup
Source
__.scala
def keyStream: Stream[A]

Key stream

Key stream

Returns a Stream of all keys for this Lookup

Inherited from
Lookup
Source
__.scala
def pairStream: Stream[(A, B)]

Key/value pair stream

Key/value pair stream

Returns a Stream of all key/value pairs for this Lookup

Inherited from
Lookup
Source
__.scala
def put(key: A, value: B): Unit

Create key/value association

Create key/value association

If given key entry already exists, it will be overridden with given value

If given key entry does not exist, it will be added, with collection increasing in size

Source
__.scala
def putAll(s: Stream[(A, B)]): Unit

Create multitiple key/value associations

Create multitiple key/value associations

This operation executes put for every stream entry

Source
__.scala
def remove(v: A): Opt[B]

Remove key association

Remove key association

Removes given key and value associated with it

Optionally returns the removed value, if it was indeed removed.

Source
__.scala
def removeAll(keys: Stream[A]): Stream[B]

Remove milti key associations

Remove milti key associations

Removes given stream of keys and values associated with them

Returns stream of removed values

Source
__.scala
def size: Int
Inherited from
Collection
Source
__.scala
def stream: Stream[B]

Value stream

Value stream

Returns a Stream of all values for this Lookup

Inherited from
Lookup
Source
__.scala
def update(key: A, value: B): Opt[B]

Update key/value association

Update key/value association

Unlike put, this operation will only update existing association, and will do nothing for non-existent.

Source
__.scala
def updateAll(s: Stream[(A, B)]): Stream[B]

Update multiple key/value associations

Update multiple key/value associations

This operation executes update for every stream entry

Source
__.scala