|
YAACC - UPNP Client and Server
|
A least-recently-used cache bounded by the summed size in bytes of its values, not by their number (the former thumbnail cache counted one unit per bitmap against a byte-sized limit, so it never evicted in practice). More...

Public Member Functions | |
| ByteLruCache (long maxBytes, ToLongFunction< V > sizer) | |
| synchronized V | get (K key) |
| synchronized void | put (K key, V value) |
| Stores the value as the most recently used one and evicts the least recently used ones until the limit holds. | |
| synchronized void | clear () |
| synchronized int | count () |
| synchronized long | bytes () |
Static Public Member Functions | |
| static long | defaultMaxBytes (long maxHeapBytes) |
| One sixteenth of the heap, but between 8 MB and 32 MB. | |
A least-recently-used cache bounded by the summed size in bytes of its values, not by their number (the former thumbnail cache counted one unit per bitmap against a byte-sized limit, so it never evicted in practice).
Thread safe; no Android classes, so the sizing function is passed in.
| synchronized void de.yaacc.util.image.ByteLruCache< K, V >.put | ( | K | key, |
| V | value ) |
Stores the value as the most recently used one and evicts the least recently used ones until the limit holds.
A value larger than the whole cache is not stored (and an older value for the key is dropped).
Referenced by de.yaacc.util.image.IconDownloadCacheHandler.addBitmap().
