net.fortuna.mstor.util
Class Cache

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<java.lang.String,javax.mail.Message>
              extended by net.fortuna.mstor.util.Cache
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,javax.mail.Message>

public class Cache
extends java.util.LinkedHashMap<java.lang.String,javax.mail.Message>

Implements a very rudimentary cache.

Author:
benfortuna
 $Id$

 Created: [8/07/2004]
 
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
Cache()
          Constructor.
Cache(int maxEntries)
          Constructor.
Cache(int initialCapacity, float loadFactor, boolean accessOrder, int maxEntries)
          Constructor.
Cache(int initialCapacity, float loadFactor, int maxEntries)
          Constructor.
Cache(int initialCapacity, int maxEntries)
          Constructor.
Cache(java.util.Map<java.lang.String,javax.mail.Message> m, int maxEntries)
          Constructor.
 
Method Summary
protected  boolean removeEldestEntry(java.util.Map.Entry<java.lang.String,javax.mail.Message> entry)
           
 
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
 

Constructor Detail

Cache

public Cache()
Constructor.


Cache

public Cache(int maxEntries)
Constructor.

Parameters:
maxEntries -

Cache

public Cache(int initialCapacity,
             int maxEntries)
Constructor.

Parameters:
initialCapacity -
maxEntries -

Cache

public Cache(int initialCapacity,
             float loadFactor,
             int maxEntries)
Constructor.

Parameters:
initialCapacity -
loadFactor -
maxEntries -

Cache

public Cache(int initialCapacity,
             float loadFactor,
             boolean accessOrder,
             int maxEntries)
Constructor.

Parameters:
initialCapacity -
loadFactor -
accessOrder -
maxEntries -

Cache

public Cache(java.util.Map<java.lang.String,javax.mail.Message> m,
             int maxEntries)
Constructor.

Parameters:
m -
maxEntries -
Method Detail

removeEldestEntry

protected final boolean removeEldestEntry(java.util.Map.Entry<java.lang.String,javax.mail.Message> entry)
Overrides:
removeEldestEntry in class java.util.LinkedHashMap<java.lang.String,javax.mail.Message>


Copyright © 2004-2011 Micronode. All Rights Reserved.