net.sf.oval.internal.util
Class ObjectCache<K,V>

java.lang.Object
  extended by net.sf.oval.internal.util.ObjectCache<K,V>

public final class ObjectCache<K,V>
extends Object

Author:
Sebastian Thomschke

Constructor Summary
ObjectCache()
          Creates a new cache keeping all objects.
ObjectCache(int maxObjectsToKeep)
           
 
Method Summary
 void compact()
           
 boolean contains(K key)
           
 V get(K key)
           
 void put(K key, V value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCache

public ObjectCache()
Creates a new cache keeping all objects.


ObjectCache

public ObjectCache(int maxObjectsToKeep)
Parameters:
maxObjectsToKeep - the number of cached objects that should stay in memory when GC starts removing SoftReferences to free memory
Method Detail

compact

public void compact()

contains

public boolean contains(K key)

get

public V get(K key)

put

public void put(K key,
                V value)


Copyright © 2005–2015 The OVal Development Team. All rights reserved.