| com.go.trove.util.Cache
Cache | public class Cache extends SoftHashMap (Code) | | Cache is a SoftHashMap that is guaranteed to have the most recently used
entries available. Calling "get" or "put" updates the internal MRU list,
but calling "containsKey" or "containsValue" will not.
Like its base class, Cache is not thread-safe and must be wrapped with
Collections.synchronizedMap to be made thread-safe.
parametrized for GJ by Stefan Reich (doc@drjava.de)
author: Brian S O'Neill version: , 01/05/30 |
Constructor Summary | |
public | Cache(int maxRecent) Construct a Cache with an amount of recently used entries that are
guaranteed to always be in the Cache. | public | Cache(Cache cache) Piggyback this Cache onto another one in order for the map of recently
used entries to be shared. |
Method Summary | |
public void | clear() | public B | get(A key) | public B | put(A key, B value) | public B | remove(A key) |
Cache | public Cache(int maxRecent)(Code) | | Construct a Cache with an amount of recently used entries that are
guaranteed to always be in the Cache.
Parameters: maxRecent - maximum amount of recently used entries guaranteed tobe in the Cache. throws: IllegalArgumentException - if maxRecent is less than or equal tozero. |
Cache | public Cache(Cache cache)(Code) | | Piggyback this Cache onto another one in order for the map of recently
used entries to be shared. If this Cache is more active than the one
it attaches to, then more of its most recently used entries will be
guaranteed to be in the Cache, possibly bumping out entries from the
other Cache.
|
clear | public void clear()(Code) | | |
put | public B put(A key, B value)(Code) | | |
remove | public B remove(A key)(Code) | | |
|
|