K- The type of a key with which a value is associated in the cache.
V- The type of a value which is stored in the cache.
public class SoftCache<K,V> extends java.lang.Object
A simple cache using
SoftReferences to store values. It allows
the values to be garbage collected if no more needed. When putting values
into the cache the values are associated with keys. The keys are then used
to retrieve values from the cache.
Note: This class is not thread-safe!
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns the value to which the specified key is mapped, or
Associates the specified value with the specified key in this cache.
nullif this cache contains no mapping for the key or if the value to which the specified key is mapped has been garbage collected.
key- the key whose associated value is to be returned
nullif no value is available for the key
key- key with which the specified value is to be associated
value- value to be associated with the specified key
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.