ucar.nc2.util
Class HashMapLRU
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
ucar.nc2.util.HashMapLRU
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public class HashMapLRU
- extends LinkedHashMap
A HashMap that removes the oldest member when it exceeds the maximum number of entries.
- Author:
- caron
- See Also:
LinkedHashMap
,
Serialized Form
Constructor Summary |
HashMapLRU(int initialCapacity,
int max_entries)
Constructor. |
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
HashMapLRU
public HashMapLRU(int initialCapacity,
int max_entries)
- Constructor.
- Parameters:
initialCapacity
- start with this sizemax_entries
- dont exceed this number of entries.
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry eldest)
- Overrides:
removeEldestEntry
in class LinkedHashMap
Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.