org.logicblaze.lingo.util
Class LRUCache
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
org.logicblaze.lingo.util.LRUCache
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public class LRUCache
- extends LinkedHashMap
A simple least-recently-used cache of a fixed size.
- Version:
- $Revision$
- See Also:
- Serialized Form
Constructor Summary |
LRUCache(int maximumSize)
|
LRUCache(int maximumSize,
boolean accessOrder)
|
LRUCache(int initialCapacity,
float loadFactor,
boolean accessOrder,
int maximumSize)
|
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
DEFAULT_LOAD_FACTOR
protected static final float DEFAULT_LOAD_FACTOR
- See Also:
- Constant Field Values
DEFAULT_INITIAL_CAPACITY
protected static final int DEFAULT_INITIAL_CAPACITY
- See Also:
- Constant Field Values
LRUCache
public LRUCache(int maximumSize)
LRUCache
public LRUCache(int maximumSize,
boolean accessOrder)
LRUCache
public LRUCache(int initialCapacity,
float loadFactor,
boolean accessOrder,
int maximumSize)
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry eldest)
- Overrides:
removeEldestEntry
in class LinkedHashMap
Copyright © 2012 LogicBlaze, Inc.. All Rights Reserved.