org.codehaus.activemq.util
Class LRUCache

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byjava.util.LinkedHashMap
              extended byorg.codehaus.activemq.util.LRUCache
All Implemented Interfaces:
Cloneable, Map, Serializable

public class LRUCache
extends LinkedHashMap

Represnts an LRUCache of a fixed maximum size which by default will remove items based on access order but can be used to use insertion order

Version:
$Revision: 1.1 $
See Also:
Serialized Form

Field Summary
protected static int DEFAULT_INITIAL_CAPACITY
           
protected static float DEFAULT_LOAD_FACTOR
           
 
Constructor Summary
LRUCache(int maxSize)
           
LRUCache(int maxSize, boolean accessOrder)
           
LRUCache(int initialCapacity, float loadFactor, boolean accessOrder, int maxSize)
           
 
Method Summary
protected  boolean removeEldestEntry(Map.Entry eldest)
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

DEFAULT_INITIAL_CAPACITY

protected static final int DEFAULT_INITIAL_CAPACITY
See Also:
Constant Field Values

DEFAULT_LOAD_FACTOR

protected static final float DEFAULT_LOAD_FACTOR
See Also:
Constant Field Values
Constructor Detail

LRUCache

public LRUCache(int initialCapacity,
                float loadFactor,
                boolean accessOrder,
                int maxSize)

LRUCache

public LRUCache(int maxSize)

LRUCache

public LRUCache(int maxSize,
                boolean accessOrder)
Method Detail

removeEldestEntry

protected boolean removeEldestEntry(Map.Entry eldest)


Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.