de.cohesion.bssh.impl.util
Class Cache<K,E>

java.lang.Object
  extended by de.cohesion.bssh.impl.util.Cache<K,E>

public class Cache<K,E>
extends java.lang.Object

A cache implementation.

On a saturated cache miss the lowest element according to the given Comparator is replaced.

Author:
schulzs

Nested Class Summary
static class Cache.ReplacementStrategy
           
 
Constructor Summary
Cache(int capacity, Factory<K,E> factory, java.util.Comparator<? super CacheEntry<K,E>> sorter)
           
 
Method Summary
 E get(K key)
           
 void invalidate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cache

public Cache(int capacity,
             Factory<K,E> factory,
             java.util.Comparator<? super CacheEntry<K,E>> sorter)
Method Detail

get

public E get(K key)
      throws java.lang.InstantiationException
Throws:
java.lang.InstantiationException

invalidate

public void invalidate()


Copyright © 2005 . All Rights Reserved.