MemoryTileCache class

This is a memory-only implementation of the TileCache. It stores the bitmaps in memory. We use a factory and remember all active instances. This way we can easily purge caches if needed.

Constructors

MemoryTileCache.create()
factory

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

dispose() → void
disposes the cache. It should not be used anymore after disposing.
get(Tile tile) → TilePicture?
Returns the requested picture or null if the picture is not available.
getOrProduce(Tile tile, Future<TilePicture?> producer(Tile)) Future<TilePicture?>
todo it may make sense to return a clone and dispose that clone at the consumer. The cache may evict an image at any time even if it is still used by the consumer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purgeAll() → void
Purges the whole cache. The cache can be used afterwards but will not return any items
purgeByBoundary(BoundingBox boundingBox) → void
Purges the cache whose Tiles intersects with the given boundingBox. Any bitmap which is fully or partially intersecting the given boundingBox will be purged.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

purgeAllCaches() → void
purgeCachesByBoundary(BoundingBox boundingBox) → void