Returns the size of the entry for key and value in user-defined units. The default implementation returns 1 so that size is the number of entries and max size is the maximum number of entries. An entry's size must not change while it is in the cache.
(K key, V value)
| 261 | * <p>An entry's size must not change while it is in the cache. |
| 262 | */ |
| 263 | protected int sizeOf(K key, V value) { |
| 264 | return 1; |
| 265 | } |
| 266 | |
| 267 | /** |
| 268 | * Clear the cache, calling {@link #entryRemoved} on each removed entry. |