org.equanda.util
Class BoundCache<KEY,VALUE>

java.lang.Object
  extended by org.equanda.util.BoundCache<KEY,VALUE>
All Implemented Interfaces:
Cache<KEY,VALUE>

public class BoundCache<KEY,VALUE>
extends Object
implements Cache<KEY,VALUE>

Simple cache which is bound to have a maximum number of cached objects. A given method is called to remove items from cache.

Author:
Joachim Van der Auwera

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.equanda.util.Cache
Cache.Loader<KEY,VALUE>, Cache.Purger<VALUE>
 
Constructor Summary
BoundCache(int maxSize, Cache.Loader<KEY,VALUE> l, Cache.Purger<VALUE> p)
           
 
Method Summary
 void clear()
           
 VALUE get(KEY key)
           
 VALUE put(KEY key, VALUE value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundCache

public BoundCache(int maxSize,
                  Cache.Loader<KEY,VALUE> l,
                  Cache.Purger<VALUE> p)
Method Detail

get

public VALUE get(KEY key)
Specified by:
get in interface Cache<KEY,VALUE>

put

public VALUE put(KEY key,
                 VALUE value)
Specified by:
put in interface Cache<KEY,VALUE>

clear

public void clear()
Specified by:
clear in interface Cache<KEY,VALUE>


Copyright © 2007-2009. All Rights Reserved.