MapDB<K, V> class
An in-memory database, backed by a Map.
MapDB offers a Stream to which interested code may subscribe. When the contents of this database are modified, the stream will emit data events containing the changes.
Note: because the database consists of key:value pairs, the author
has found it convenient for the Stream to traffic in Tuple2
objects,
where the Tuple's first value is the key and the second is the value.
Constructors
- MapDB()
- Constructs an empty MapDB.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
K key) → V? -
Removes
key
from the database. -
get(
K key) → V? -
Get the value stored at
key
in this database. If there isn't one, this method will returnnull
rather than throw an exception. -
getChangesForKey(
K key) → Stream< V?> -
Get the change Stream for
key
. -
getChangeStream(
) → Stream< Tuple2< K, V?> > - Get the change Stream for this database.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
K key, V value) → V? -
Inserts (or replaces)
value
atkey
in this database. -
toString(
) → String -
A string representation of this object.
inherited
-
values(
) → Iterable< V> - Get all the values that are stored in this database.
-
valuesStream(
) → Stream< List< V> > - Receive a list of all the values in this database, updated whenever the values change.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited