net.spy.cache
Class LRUCache

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.cache.LRUCache

public class LRUCache
extends SpyObject

A fixed-size least-recently-used cache.


Constructor Summary
LRUCache(int size)
          Get an instance of LRUCache.
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          Get the named object from the cache.
 void put(java.lang.Object key, java.lang.Object value)
          Store an object in the cache.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LRUCache

public LRUCache(int size)
Get an instance of LRUCache.

Method Detail

get

public java.lang.Object get(java.lang.Object key)
Get the named object from the cache.

Parameters:
key - the key
Returns:
the value, or null if this mapping is not in the cache

put

public void put(java.lang.Object key,
                java.lang.Object value)
Store an object in the cache. This may cause an object to be removed from the cache to make room.

Parameters:
key - the cache key
value - the cache value


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.