org.neo4j.kernel.impl.cache
Class WeakLruCache<K,V>

java.lang.Object
  extended by org.neo4j.kernel.impl.cache.ReferenceCache<K,V>
      extended by org.neo4j.kernel.impl.cache.WeakLruCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class WeakLruCache<K,V>
extends ReferenceCache<K,V>


Constructor Summary
WeakLruCache(String name)
           
 
Method Summary
 void clear()
          Removing all cached elements.
 void elementCleaned(V value)
           
 V get(K key)
          Returns the cached element for key.
 String getName()
          Returns the name of the cache.
 long hitCount()
           
 boolean isAdaptive()
           
 int maxSize()
           
 long missCount()
           
protected  void pollClearedValues()
           
 void put(K key, V value)
          Adds element to cache.
 void putAll(Map<K,V> map)
           
 V remove(K key)
          Removes the element for key from cache and returns it.
 void resize(int newSize)
           
 void setAdaptiveStatus(boolean status)
           
 int size()
          Returns the cache size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakLruCache

public WeakLruCache(String name)
Method Detail

put

public void put(K key,
                V value)
Description copied from interface: Cache
Adds element to cache.

Parameters:
key - the key for the element

putAll

public void putAll(Map<K,V> map)

get

public V get(K key)
Description copied from interface: Cache
Returns the cached element for key. If the element isn't in cache null is returned.

Parameters:
key - the key for the element
Returns:
the cached element or null if element didn't exist

remove

public V remove(K key)
Description copied from interface: Cache
Removes the element for key from cache and returns it. If the no element for key exists null is returned.

Parameters:
key - the key for the element
Returns:
the removed element or null if element didn't exist

pollClearedValues

protected void pollClearedValues()
Specified by:
pollClearedValues in class ReferenceCache<K,V>

size

public int size()
Description copied from interface: Cache
Returns the cache size.

Returns:
cache size

clear

public void clear()
Description copied from interface: Cache
Removing all cached elements.


hitCount

public long hitCount()

missCount

public long missCount()

elementCleaned

public void elementCleaned(V value)

getName

public String getName()
Description copied from interface: Cache
Returns the name of the cache.

Returns:
name of the cache

isAdaptive

public boolean isAdaptive()

maxSize

public int maxSize()

resize

public void resize(int newSize)

setAdaptiveStatus

public void setAdaptiveStatus(boolean status)


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.