net.jini.jeri.kerberos
Class KerberosUtil.SoftCache.LRUHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap
              extended by net.jini.jeri.kerberos.KerberosUtil.SoftCache.LRUHashMap
All Implemented Interfaces:
Serializable, Cloneable, Map
Enclosing class:
KerberosUtil.SoftCache

private class KerberosUtil.SoftCache.LRUHashMap
extends LinkedHashMap

A linked hash map that implements LRU replacement policy


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
private  int maxCacheSize
           
 
Constructor Summary
KerberosUtil.SoftCache.LRUHashMap(int maxCacheSize, int initialCapacity)
          Construct an instance of the hash map.
 
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
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Field Detail

maxCacheSize

private int maxCacheSize
Constructor Detail

KerberosUtil.SoftCache.LRUHashMap

KerberosUtil.SoftCache.LRUHashMap(int maxCacheSize,
                                  int initialCapacity)
Construct an instance of the hash map.

Parameters:
maxCacheSize - maximum number of entries allowed in this map
initialCapacity - initial capacity of the map
Throws:
IllegalArgumentException - if maxCacheSize is negative
Method Detail

removeEldestEntry

protected boolean removeEldestEntry(Map.Entry eldest)
Overrides:
removeEldestEntry in class LinkedHashMap


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.