# Class: com.pnfsoftware.jeb.util.collect.CacheMap

A simple [CacheMap](CacheMap), with optional support for cached entries ordering.

## Constructor: CacheMap
- parameter: `maxSize`, type: `int`
- parameter: `evictSize`, type: `int`
- parameter: `ordered`, type: `boolean`

Description: Construct a cache map. Whenever an element is added and the map exceeds the maximum size, it will be partially cleaned up by evicting the last accessed objects.
parameter: maxSize: maximum size of the cache map
parameter: evictSize: number of objects evicted during a partial cache cleanup
parameter: ordered: true to naturally order elements in the map

## Constructor: CacheMap
- parameter: `maxSize`, type: `int`
- parameter: `evictSize`, type: `int`

Description: Construct a cache map. Whenever an element is added and the map exceeds the maximum size, it will be partially cleaned up by evicting the last accessed objects.
parameter: maxSize: maximum size of the cache map
parameter: evictSize: number of objects evicted during a partial cache cleanup

## Constructor: CacheMap
- parameter: `maxSize`, type: `int`

Description: Construct a cache map with an eviction size equals to 25% of the cache size.
parameter: maxSize: maximum size of the map

## Field: dbgHitCount
Type: `int`

## Field: dbgQueryCount
Type: `int`

## Method: clear

Description: Remove all cached entries.

## Method: containsKey
- parameter: `key`, type: `K`
- return type: `boolean`

Description: Determine whether a key is cached.
parameter: key: key
return: true if the key is cached

## Method: get
- parameter: `key`, type: `K`
- return type: `V`

Description: Retrieve a cached entry.
parameter: key: key
return: cached value, or null if absent

## Method: keys
- return type: `java.util.Set<K>`

Description: 
return: a copy of the cache keys \(the client may modify the returned set, it will not impact         the cache\)

## Method: put
- parameter: `key`, type: `K`
- parameter: `val`, type: `V`
- return type: `V`

Description: Add or replace a cached entry.
parameter: key: key
parameter: val: value
return: previous value, or null

## Method: remove
- parameter: `key`, type: `K`
- return type: `V`

Description: Remove a cached entry.
parameter: key: key
return: removed value, or null

## Method: removeRange
- parameter: `fromKey`, type: `K`
- parameter: `toKey`, type: `K`
- return type: `boolean`

Description: 
parameter: fromKey: start of range
parameter: toKey: end of range \(exclusive\)
return: true if some entries were removed

## Method: size
- return type: `int`

Description: Get the current cache size.
return: number of cached entries

