InlineImageCacheLedger class final

Insertion-ordered inline-image cache accounting.

This tracks encoded byte lengths, not decoded pixels. evictStale removes the oldest unplaced entries until both policy bounds are met.

Constructors

InlineImageCacheLedger([InlineImageCachePolicy policy = defaultInlineImageCachePolicy])

Properties

entryCount → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
policy → InlineImageCachePolicy
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
totalBytes → int
no setter

Methods

add(String id, int byteLength) → bool
Records a newly cached id. Returns false when it was already present.
canFit({int additionalEntries = 0, int additionalBytes = 0}) → bool
Whether the current cache plus a prospective addition fits the policy.
clear() → void
contains(String id) → bool
evictStale(Set<String> placed) → List<String>
Evicts the oldest ids not in placed, returning them in eviction order.
evictStaleToFit(Set<String> placed, {int additionalEntries = 0, int additionalBytes = 0}) → List<String>
Evicts the oldest ids not in placed until a prospective addition fits.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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