org.eclipse.actf.util.httpproxy.util
Class CacheMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.TreeMap<String,Object>
org.eclipse.actf.util.httpproxy.util.CacheMap
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,Object>, NavigableMap<String,Object>, SortedMap<String,Object>
public class CacheMap
- extends TreeMap<String,Object>
Utility class for cache map.
- See Also:
- Serialized Form
Constructor Summary |
CacheMap(int maxSize,
int evictSize)
Constructor of cache map. |
Methods inherited from class java.util.TreeMap |
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, putAll, remove, size, subMap, subMap, tailMap, tailMap, values |
CacheMap
public CacheMap(int maxSize,
int evictSize)
- Constructor of cache map. If the map exceed the maximum size, the
key/value sets will be removed from map based on specified evict size.
- Parameters:
maxSize
- maximum size of the mapevictSize
- number of evict object
put
public Object put(String key,
Object val)
- Specified by:
put
in interface Map<String,Object>
- Overrides:
put
in class TreeMap<String,Object>
get
public Object get(Object key)
- Specified by:
get
in interface Map<String,Object>
- Overrides:
get
in class TreeMap<String,Object>
matchStartsWith
public Object matchStartsWith(String prefix)
- Search a key that starts with the specified prefix from the map, and
return the value corresponding to the key.
- Parameters:
prefix
- target prefix
- Returns:
- the value whose key starts with prefix, or null if not available