| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static <K, V> LRUCache | Returns: An LRUCache that can be used to quickly retrieve objectsThe maximum number of entries in the cache, must be greater than 2 maxCacheSize)Creates a cache with the given maximum cache size |
| public abstract V | Returns: The value associated with the key, or null if there is no such valueMust be a non-null key, appropriate for use as the key to a hash map key)Returns the value associated with the given key. |
| public abstract int | Returns: The maximum number of entries that will be stored in this cacheReturns the maximum number of entries that will be stored in this cache |
| public abstract CacheEntry | Returns: A cache entry that can be used to remove this entry from the cache. Will not return nullMust be a non-null key, appropriate for use as the key to a hash map key, V Must be a non-null value value)Adds the given key and value pair into the cache |
| public abstract void | |
| public abstract void | releaseMatching(CacheKeyFilter<K>
Entries in the cache that match this filter will
be removed from the cache. If filter is null nothing
will be removed from the cache filter)This method will remove all cache entries for which this filter matches |
| LRUCache | back to summary |
|---|---|
| public LRUCache() | |
| createCache | back to summary |
|---|---|
| public static <K, V> LRUCache Creates a cache with the given maximum cache size
| |
| get | back to summary |
|---|---|
| public abstract V get(K key) Returns the value associated with the given key. If there is no value, returns null
| |
| getMaxCacheSize | back to summary |
|---|---|
| public abstract int getMaxCacheSize() Returns the maximum number of entries that will be stored in this cache
| |
| put | back to summary |
|---|---|
| public abstract CacheEntry put(K key, V value) Adds the given key and value pair into the cache
| |
| releaseCache | back to summary |
|---|---|
| public abstract void releaseCache() Clears all entries in the cache, for use when a known event makes the cache incorrect | |
| releaseMatching | back to summary |
|---|---|
| public abstract void releaseMatching(CacheKeyFilter<K> filter) This method will remove all cache entries for which this filter matches
| |