Fmap<T> class
A Map implementation that stores its entries in files.
Dictionary keys are always of type String
. These can be arbitrary strings, limited only by
size: after encoding in UTF-8, the string must fit into 64 kilobytes.
Values can be of type String
, List<int>
(array of bytes), and also int
, double
or bool
.
We can conventionally assume that each entry will be stored in a separate file. In fact, in the case of a hash collision, a file may include two or more entries. But collisions are rare.
Properties
- directory → Directory
-
The directory inside which the data is stored. The directory can be non-existent
when the object is created.
final
-
entries
→ Iterable<
MapEntry< String, T> > -
The map entries of this.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- innerDir ↔ Directory
-
getter/setter pair
- isEmpty → bool
-
Whether there is no key/value pair in the map.
no setterinherited
- isNotEmpty → bool
-
Whether there is at least one key/value pair in the map.
no setterinherited
-
keys
→ Iterable<
String> -
The keys of this.
no setteroverride
- keyToHash ↔ HashFunc
-
getter/setter pair
- length → int
-
The number of key/value pairs in the map.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- updateTimestampsOnRead → bool
-
final
-
values
→ Iterable<
T?> -
The values of this.
no setterinherited
Methods
-
addAll(
Map< String, T?> other) → void -
Adds all key/value pairs of
other
to this map.inherited -
addEntries(
Iterable< MapEntry< newEntries) → voidString, T?> > -
Adds all key/value pairs of
newEntries
to this map.inherited -
cast<
RK, RV> () → Map< RK, RV> -
Provides a view of this map as having
RK
keys andRV
instances, if necessary.inherited -
clear(
) → void -
Removes all entries from the map.
override
-
containsKey(
Object? key) → bool -
Whether this map contains the given
key
.override -
containsValue(
Object? value) → bool -
Whether this map contains the given
value
.inherited -
deleteSync(
String key) → TypedBlob? -
forEach(
void action(String key, T? value)) → void -
Applies
action
to each key/value pair of the map.inherited -
keyToFile(
String key) → File -
map<
K2, V2> (MapEntry< K2, V2> transform(String key, T? value)) → Map<K2, V2> -
Returns a new map where all entries of this map are transformed by
the given
convert
function.inherited -
maybeUpdateTimestampAsync(
File file) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
purge(
int maxSizeBytes) → void -
Removes old data from storage, reducing the maximum total directory size to
maxSizeBytes
. -
putIfAbsent(
String key, T? ifAbsent()) → T? -
Look up the value of
key
, or add a new entry if it isn't there.inherited -
readSync(
String key) → TypedBlob? - ///////////////////////////////////////////////////////////////////////////////////////////////
-
remove(
Object? key) → T? -
Removes
key
and its associated value, if present, from the map.override -
removeWhere(
bool test(String key, T? value)) → void -
Removes all entries of this map that satisfy the given
test
.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
update(
String key, T? update(T? value), {T? ifAbsent()?}) → T? -
Updates the value for the provided
key
.inherited -
updateAll(
T? update(String key, T? value)) → void -
Updates all values.
inherited
-
writeSync(
String key, TypedBlob data) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object? key) → T? -
The value for the given
key
, ornull
ifkey
is not in the map.override -
operator []=(
String key, T? value) → void -
Associates the
key
with the givenvalue
.override