Package org.biojava.utils.cache
Class FixedSizeMap
- java.lang.Object
-
- org.biojava.utils.cache.FixedSizeMap
-
- All Implemented Interfaces:
CacheMap
public class FixedSizeMap extends Object implements CacheMap
A cache that only remembers a given number of keys.- Since:
- 1.2
- Author:
- Matthew Pocock
-
-
Constructor Summary
Constructors Constructor Description FixedSizeMap(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(Object key)Retrieve the Object associated with the key, or null if either no value has been associated or if the key's value has been cleared by the cache.intgetMaxSize()voidput(Object key, Object value)Associate a value with a key.voidremove(Object key)Explicitly remove an object.
-
-
-
Constructor Detail
-
FixedSizeMap
public FixedSizeMap(int maxSize)
-
-
Method Detail
-
getMaxSize
public int getMaxSize()
-
put
public void put(Object key, Object value)
Description copied from interface:CacheMapAssociate a value with a key. The association may be broken at any time.
-
get
public Object get(Object key)
Description copied from interface:CacheMapRetrieve the Object associated with the key, or null if either no value has been associated or if the key's value has been cleared by the cache.
-
-