TimedMap<K, V> class
- Implemented types
-
- Map<
K, V>
- Map<
- Available extensions
Constructors
Properties
-
entries
→ Iterable<
MapEntry< K, V> > -
Returns the entries of this instance, without check keyTimeout.
See checkAllEntries.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether there is no key/value pair in the map.
no setteroverride
- isNotEmpty → bool
-
Whether there is at least one key/value pair in the map.
no setteroverride
-
keys
→ Iterable<
K> -
Returns the keys of this instance, without check keyTimeout.
See checkAllEntries.
no setteroverride
- keyTimeout → Duration
-
The key timeout. When a key is put, it expires after the timeout Duration.
final
- keyTimeoutChecker → bool? Function(TimedMap timedMap, Object? key, Duration elapsedTime, Duration keyTimeout)?
-
final
- length → int
-
The number of key/value pairs in the map.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
→ Iterable<
V> -
Returns the values of this instance, without check keyTimeout.
See checkAllEntries.
no setteroverride
Methods
-
addAll(
Map< K, V> other) → void -
Adds all key/value pairs of
otherto this map.override -
addEntries(
Iterable< MapEntry< newEntries) → voidK, V> > -
Adds all key/value pairs of
newEntriesto this map.override -
bestOrder(
) → Map< K, CreateTableSQL> -
Available on Map<
K, CreateTableSQL> , provided by the SQLBuilderMapExtension extension -
cast<
RK, RV> () → Map< RK, RV> -
Provides a view of this map as having
RKkeys andRVinstances, if necessary.override -
checkAllEntries(
{DateTime? now, Duration? keyTimeout}) → int - Checks all the entries of this instance.
-
checkCachedEntry(
K key) → void -
Available on Map<
K, V> , provided by the MapAsCacheExtension extension -
checkCacheLimit(
int? cacheLimit) → int -
Available on Map<
Checks if this Map.length is bigger thanK, V> , provided by the MapAsCacheExtension extensioncacheLimitand removes elements to not exceed thecacheLimit. -
checkEntry(
Object? key, {DateTime? now, Duration? keyTimeout}) → bool -
Check the
keyentry timeout. Returnstrueif thekeyexpired. -
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.override -
entriesChecked(
{DateTime? now, Duration? keyTimeout}) → List< MapEntry< K, V> > -
Returns the entries of this instance checking
keyTimeout. See checkAllEntries. -
equivalentCaches(
C context) → Iterable< M> -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
forEach(
void action(K key, V value)) → void -
Applies
actionto each key/value pair of the map.override -
get(
K key, {V? defaultValue, bool ignoreCase = false}) → V? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue. -
getAs<
T> (K key, {T? defaultValue, bool ignoreCase = false}) → T? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing toTtype. -
getAsBool(
K key, {bool? defaultValue, bool ignoreCase = false}) → bool? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as bool. -
getAsDouble(
K key, {double? defaultValue, bool ignoreCase = false}) → double? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as double. -
getAsInt(
K key, {int? defaultValue, bool ignoreCase = false}) → int? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as int. -
getAsList<
E> (K key, {List< E> ? def, TypeElementParser<E> ? elementParser, List<E> ? defaultValue, bool ignoreCase = false}) → List<E> ? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as List. -
getAsMap(
K key, {Map< K, V> ? def, TypeElementParser<K> ? keyParser, TypeElementParser<V> ? valueParser, Map<K, V> ? defaultValue, bool ignoreCase = false}) → Map<K, V> ? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as Map. -
getAsNum(
K key, {num? defaultValue, bool ignoreCase = false}) → num? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing to num type. -
getAsSet<
E> (K key, {Set< E> ? def, TypeElementParser<E> ? elementParser, Set<E> ? defaultValue, bool ignoreCase = false}) → Set<E> ? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as Set. -
getAsString(
K key, {String? defaultValue, bool ignoreCase = false}) → String? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing as String. -
getCache(
C context, M cacheInstantiator()) → M -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
getCached(
K key, V computer(), {int? cacheLimit}) → V -
Available on Map<
ReturnsK, V> , provided by the MapAsCacheExtension extensionkeyvalue or computes it and caches it. See checkCachedEntry, checkCacheLimit and getCachedAsync. -
getCachedAsync(
K key, FutureOr< V> computer(), {int? cacheLimit}) → FutureOr<V> -
Available on Map<
Same as getCached but accepts aK, V> , provided by the MapAsCacheExtension extensioncomputerthat returns a Future. See checkCachedEntry, checkCacheLimit and getCachedAsync. -
getCachedAsyncNullable(
K key, FutureOr< V?> computer(), {int? cacheLimit}) → FutureOr<V?> -
Available on Map<
K, V> , provided by the MapAsCacheExtension extension -
getCachedNullable(
K key, V? computer(), {int? cacheLimit}) → V? -
Available on Map<
K, V> , provided by the MapAsCacheExtension extension -
getChecked(
K key, {DateTime? now, Duration? keyTimeout}) → V? -
Returns a
keycheckingkeyTimeout. -
getElapsedTime(
Object? key, {DateTime? now}) → Duration? -
Returns the elapsed time of
key, since the put. -
getFirstValue(
K key, {bool ignoreCase = false}) → String? -
Available on Map<
Returns the first value forK, Object> , provided by the MapMultiValueExtension extensionkey, if present. -
getIfCached(
K key, {int? cacheLimit}) → V? -
Available on Map<
ReturnsK, V> , provided by the MapAsCacheExtension extensionkeyvalue, checking if it's still valid. See checkCachedEntry and checkCacheLimit. -
getIfCached(
K key, C context, M cacheInstantiator()) → V? -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
getIgnoreCase(
K key, {V? defaultValue}) → V? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue ignoring case. -
getMultiCached(
K key, C context, M cacheInstantiator(), V computer()) → V -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
getMultiCachedAsync(
K key, C context, M cacheInstantiator(), FutureOr< V> computer()) → FutureOr<V> -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
getMultiCachedAsyncNullable(
K key, C context, M cacheInstantiator(), FutureOr< V?> computer()) → FutureOr<V?> -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
getMultiCachedNullable(
K key, C context, M cacheInstantiator(), V? computer()) → V? -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
getMultiKeyAsBool(
List< K> keys, {bool? defaultValue, bool ignoreCase = false}) → bool? -
Available on Map<
Gets the value of the first matchingK, V> , provided by the MapGetterExtension extensionkeys, parsing as bool. -
getMultiKeyAsDouble(
List< K> keys, {double? defaultValue, bool ignoreCase = false}) → double? -
Available on Map<
Gets the value of the first matchingK, V> , provided by the MapGetterExtension extensionkeys, parsing as double. -
getMultiKeyAsInt(
List< K> keys, {int? defaultValue, bool ignoreCase = false}) → int? -
Available on Map<
Gets the value of the first matchingK, V> , provided by the MapGetterExtension extensionkeys, parsing as int. -
getMultiKeyAsNum(
List< K> keys, {num? defaultValue, bool ignoreCase = false}) → num? -
Available on Map<
Gets the value of the first matchingK, V> , provided by the MapGetterExtension extensionkeys, parsing as num. -
getMultiKeyAsString(
List< K> keys, {String? defaultValue, bool ignoreCase = false}) → String? -
Available on Map<
Gets the value of the first matchingK, V> , provided by the MapGetterExtension extensionkeys, parsing as num. -
getMultiKeyParsed<
T> (List< K> keys, TypeElementParser<T> ? parser, {T? defaultValue, bool ignoreCase = false}) → T? -
Available on Map<
Same as getParsed but accepts multipleK, V> , provided by the MapGetterExtension extensionkeys. -
getMultiValue(
K key, {bool ignoreCase = false}) → List< String> ? -
Available on Map<
Returns the first values forK, Object> , provided by the MapMultiValueExtension extensionkey. -
getParsed<
T> (K key, TypeElementParser< T> ? parser, {T? defaultValue, bool ignoreCase = false}) → T? -
Available on Map<
Gets aK, V> , provided by the MapGetterExtension extensionkeyvalue parsing withparser. -
getTime(
Object? key) → DateTime? -
Returns the time (DateTime) of a
key. -
isEntryExpired(
Object? key, {DateTime? now, Duration? keyTimeout}) → bool -
Returns
trueif thekeyentry is expired (reached the timeout). -
isEquivalentContext(
C context1, C context2) → bool -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
keysChecked(
{DateTime? now, Duration? keyTimeout}) → List< K> -
Returns the keys of this instance checking
keyTimeout. See checkAllEntries. -
map<
K2, V2> (MapEntry< K2, V2> convert(K key, V value)) → TimedMap<K2, V2> -
Returns a new map where all entries of this map are transformed by
the given
convertfunction.override -
matchKey(
K key) → K? -
Available on Map<
Returns the existing key that matchesK, V> , provided by the MapGetterExtension extensionkey. -
matchKeyIgnoreCase(
K key) → K? -
Available on Map<
Returns the existing key that matchesK, V> , provided by the MapGetterExtension extensionkeyas case-insensitive. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
populateMultiCache(
K key, C context, M cacheInstantiator(), V value) → void -
Available on Map<
C, Map< , provided by the MapOfCachesExtension extensionK, V> > -
put(
K key, V value, {DateTime? now}) → void -
Sets a
keyvalue. -
putIfAbsent(
K key, V ifAbsent()) → V -
Look up the value of
key, or add a new entry if it isn't there.override -
putIfAbsentChecked(
K key, V ifAbsent(), {DateTime? now, Duration? keyTimeout}) → V - Same as putIfAbsent, but calls checkEntry first.
-
putIfAbsentCheckedAsync(
K key, FutureOr< V> ifAbsent(), {DateTime? now, Duration? keyTimeout}) → FutureOr<V> -
Same as putIfAbsentChecked, but accepts an async function for
ifAbsent. -
remove(
Object? key) → V? -
Removes
keyand its associated value, if present, from the map.override -
removeWhere(
bool test(K key, V value)) → void -
Removes keys where
testreturnstrue. See removeWhereTimed.override -
removeWhereTimed(
bool test(K key, V value, DateTime time)) → void -
Removes keys where
testreturnstrue. See removeWhere. -
setMultiValue(
K key, String value, {bool ignoreCase = false}) → void -
Available on Map<
Sets the value forK, Object> , provided by the MapMultiValueExtension extensionkey. If the value already exists, ensures that is aList<String>. -
toHierarchicalOrder(
) → Map< K, CreateTableSQL> -
Available on Map<
K, CreateTableSQL> , provided by the SQLBuilderMapExtension extension -
toString(
) → String -
A string representation of this object.
override
-
update(
K key, V update(V value), {V ifAbsent()?}) → V -
Updates the value for the provided
key.override -
updateAll(
V update(K key, V value)) → void -
Updates all values.
override
-
updateAllTimed(
V update(K key, V value, DateTime time)) → void -
Same as updateAll, but with an extra parameter
timein functionupdate. -
updateTimed(
K key, V update(V value), {V ifAbsent()?, DateTime? now, Duration? keyTimeout}) → V -
Same as
update, but calls checkEntry first. -
valuesChecked(
{DateTime? now, Duration? keyTimeout}) → List< V> -
Returns the values of this instance checking
keyTimeout. See checkAllEntries.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object? key) → V? -
Returns a
keywithout check keyTimeout. See getChecked.override -
operator []=(
K key, V value) → void -
Sets a
keyvalue. See put.override