ExpirableMap<K, V extends Expirable> class

Maps K to the Expirable V objects. These objects are removed when expired. K should have Object.operator== and Object.hashCode implemented.

Constructors

ExpirableMap.new({void onExpired(K, V)?})
ExpirableMap.of(Map<K, V> map, {void onExpired(K, V)?})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Iterable<V>
no setter

Methods

clear() → void
containsKey(K key) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(K key) → V?
Remove the entry at key and return the removed value. Returns null if the key was not in the map. Does not call this.onExpired.
removeWhere(bool test(K key, V value)) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](K key) → V?
Obtain the object if it is not expired.
operator []=(K key, V value) → void
Adds the object to the map