com.khubla.pragmatach.framework.cache
Class LRUCache<K,V>

java.lang.Object
  extended by com.khubla.pragmatach.framework.cache.LRUCache<K,V>

public class LRUCache<K,V>
extends Object

A simple LRU cache, based on multiple examples from "The Google".

Author:
tome

Constructor Summary
LRUCache(int cacheSize)
          ctor
 
Method Summary
 void clear()
           
 V get(K key)
           
 Collection<Map.Entry<K,V>> getAll()
           
 long getTotalHits()
           
 long getTotalRequests()
           
 void put(K key, V value)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LRUCache

public LRUCache(int cacheSize)
ctor

Method Detail

clear

public void clear()

get

public V get(K key)

getAll

public Collection<Map.Entry<K,V>> getAll()

getTotalHits

public long getTotalHits()

getTotalRequests

public long getTotalRequests()

put

public void put(K key,
                V value)

size

public int size()


Copyright © 2014 khubla.com. All rights reserved.