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

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`CacheMap(int maxSize, int evictSize)` Constructor of cache map.

### Method Summary

Methods
`Object` `get(Object key)`
`Object` `matchStartsWith(String prefix)` Search a key that starts with the specified prefix from the map, and return the value corresponding to the key.
`Object` `put(String key, Object val)`

### 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`

### Methods inherited from class java.util.AbstractMap

`equals, hashCode, isEmpty, toString`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Map

`equals, hashCode, isEmpty`

### Constructor Detail

#### 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 map
  `evictSize` - number of evict object

### Method Detail

#### 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