| java.util.LinkedHashMap org.geotools.util.LRULinkedHashMap
LRULinkedHashMap | final public class LRULinkedHashMap extends LinkedHashMap (Code) | | A
Map with a fixed maximum size which removes the least recently used (LRU)
entry if an entry is added when full. This class implements a simple technique for LRU pooling
of objects.
Note that this cache is based on hard references, not on
or
because especially for server
side applications such caches are often too aggressively cleared.
version: $Id: LRULinkedHashMap.java 22443 2006-10-27 20:47:22Z desruisseaux $ author: Simone Giannecchini since: 2.3 |
Constructor Summary | |
public | LRULinkedHashMap() Constructs a
LRULinkedHashMap with default initial capacity, maximum capacity
and load factor. | public | LRULinkedHashMap(int initialCapacity) Constructs a
LRULinkedHashMap with default maximum capacity and load factor. | public | LRULinkedHashMap(int initialCapacity, float loadFactor) Constructs a
LRULinkedHashMap with default maximum capacity. | public | LRULinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) Constructs a
LRULinkedHashMap with default maximum capacity. | public | LRULinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder, int maxEntries) Constructs a
LRULinkedHashMap with the specified maximum capacity. |
LRULinkedHashMap | public LRULinkedHashMap()(Code) | | Constructs a
LRULinkedHashMap with default initial capacity, maximum capacity
and load factor.
|
LRULinkedHashMap | public LRULinkedHashMap(int initialCapacity)(Code) | | Constructs a
LRULinkedHashMap with default maximum capacity and load factor.
Parameters: initialCapacity - The initial capacity. |
LRULinkedHashMap | public LRULinkedHashMap(int initialCapacity, float loadFactor)(Code) | | Constructs a
LRULinkedHashMap with default maximum capacity.
Parameters: initialCapacity - The initial capacity. Parameters: loadFactor - The load factor. |
LRULinkedHashMap | public LRULinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder)(Code) | | Constructs a
LRULinkedHashMap with default maximum capacity.
Parameters: initialCapacity - The initial capacity. Parameters: loadFactor - The load factor. Parameters: accessOrder - The ordering mode: true for access-order, false for insertion-order. |
LRULinkedHashMap | public LRULinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder, int maxEntries)(Code) | | Constructs a
LRULinkedHashMap with the specified maximum capacity.
Parameters: initialCapacity - The initial capacity. Parameters: loadFactor - The load factor. Parameters: accessOrder - The ordering mode: true for access-order, false for insertion-order. Parameters: maxEntries - Maximum number of entries for this LRU cache. |
removeEldestEntry | protected boolean removeEldestEntry(Map.Entry eldest)(Code) | | Returns
true if this map should remove its eldest entry. The default implementation
returns
true if the
in this map has reached the
maximum number of entries specified at construction time.
Parameters: eldest - The least recently inserted entry in the map, or if this is an access-orderedmap, the least recently accessed entry. This is the entry that will be removed it thismethod returns true . true if the eldest entry should be removed from the map; false if it should be retained. |
|
|