org.gcube.data.spd.obisplugin.util
Class Cache<K,V>

java.lang.Object
  extended by org.gcube.data.spd.obisplugin.util.Cache<K,V>

public class Cache<K,V>
extends Object

Author:
"Federico De Faveri defaveri@isti.cnr.it"

Field Summary
protected  Map<K,V> cache
           
protected  boolean enableStatistics
           
protected  long hints
           
protected  int limit
           
protected  long removed
           
protected  long requests
           
 
Constructor Summary
Cache(int limit)
           
 
Method Summary
 V get(K key)
           
 long getHints()
           
 int getLimit()
           
 long getRequests()
           
 boolean isEnableStatistics()
           
 void put(K key, V value)
           
 void setEnableStatistics(boolean enableStatistics)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

limit

protected int limit

cache

protected Map<K,V> cache

enableStatistics

protected boolean enableStatistics

hints

protected long hints

requests

protected long requests

removed

protected long removed
Constructor Detail

Cache

public Cache(int limit)
Method Detail

isEnableStatistics

public boolean isEnableStatistics()
Returns:
the enableStatistics

setEnableStatistics

public void setEnableStatistics(boolean enableStatistics)
Parameters:
enableStatistics - the enableStatistics to set

getRequests

public long getRequests()
Returns:
the requests

getLimit

public int getLimit()
Returns:
the limit

getHints

public long getHints()
Returns:
the hints

get

public V get(K key)

put

public void put(K key,
                V value)

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.