| java.lang.Object org.eclipse.jdi.internal.ValueCache
ValueCache | public class ValueCache (Code) | | This class is used to cache values.
It uses soft references to store cached values. Once a value is garbage collected by the VM,
the corresponding entry is removed from the cache on the next invocation of put() or get().
Note that WeakHashMap can't be used for this purpose because in WeakHashMap
soft references are only used for the keys, and values may not have 'strong' references
to keys otherwise they will never be garbage collected.
|
Method Summary | |
public Object | get(Object key) Get entry from the cache. | public void | put(Object key, Object value) Put a new entry in the cache under the given key. | public Object | remove(Object key) Removes the key and its corresponding value from this cache. | public Collection | values() Returns a Collection view of the values contained in this cache. | public Collection | valuesWithType(Class type) Returns a Collection view of the values contained in this cache that have the same
runtime class as the given Class. |
get | public Object get(Object key)(Code) | | Get entry from the cache.
Returns value that is cached under the given key,or null of one of the following is true:- The value has not been cached.- The value had been cached but is garbage collected. |
put | public void put(Object key, Object value)(Code) | | Put a new entry in the cache under the given key.
|
remove | public Object remove(Object key)(Code) | | Removes the key and its corresponding value from this cache.
Returns The value to which the key had been mapped in this hashtable,or null if the key did not have a mapping. |
values | public Collection values()(Code) | | Returns a Collection view of the values contained in this cache.
|
valuesWithType | public Collection valuesWithType(Class type)(Code) | | Returns a Collection view of the values contained in this cache that have the same
runtime class as the given Class.
|
|
|