org.apache.openjpa.lib.util
Class LRUMap
java.lang.Object
org.apache.commons.collections.map.LRUMap
org.apache.openjpa.lib.util.LRUMap
- All Implemented Interfaces:
- Map, SizedMap
public class LRUMap
- extends LRUMap
- implements SizedMap
Extension of the commons LRUMap
that can change its
maximum size.
- Author:
- Abe White
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
LRUMap
public LRUMap()
LRUMap
public LRUMap(int maxSize)
LRUMap
public LRUMap(int maxSize,
float loadFactor)
LRUMap
public LRUMap(Map map)
getMaxSize
public int getMaxSize()
- Description copied from interface:
SizedMap
- The maximum number of entries, or Integer.MAX_VALUE for no limit.
- Specified by:
getMaxSize
in interface SizedMap
setMaxSize
public void setMaxSize(int max)
- Description copied from interface:
SizedMap
- The maximum number of entries, or Integer.MAX_VALUE for no limit.
- Specified by:
setMaxSize
in interface SizedMap
overflowRemoved
public void overflowRemoved(Object key,
Object value)
- Description copied from interface:
SizedMap
- Overridable callback for when an overflow entry is automatically removed.
- Specified by:
overflowRemoved
in interface SizedMap
maxSize
public int maxSize()
isFull
public boolean isFull()
- Description copied from interface:
SizedMap
- Whether the map is full.
- Specified by:
isFull
in interface SizedMap
removeLRU
protected boolean removeLRU(LinkEntry entry)
doWriteObject
protected void doWriteObject(ObjectOutputStream out)
throws IOException
- Throws:
IOException
doReadObject
protected void doReadObject(ObjectInputStream in)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
Copyright © 2006 Apache Software Foundation. All Rights Reserved.