org.apache.ojb.broker.cache
Class ObjectCacheSoftImpl.SoftHashMap

java.lang.Object
  extended by org.apache.ojb.broker.cache.ObjectCacheSoftImpl.SoftHashMap
Enclosing class:
ObjectCacheSoftImpl

public static final class ObjectCacheSoftImpl.SoftHashMap
extends java.lang.Object

Kind of map using SoftReference to store values


Constructor Summary
ObjectCacheSoftImpl.SoftHashMap(int hardSize)
          Construct a new hash map with the specified size
 
Method Summary
 void clear()
          Clear the map
 java.lang.Object get(java.lang.Object key)
          Retrieve the value associated to a given key
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Put the key, value pair into the HashMap using a SoftValue object
 java.lang.Object remove(java.lang.Object key)
          Remove the entry for this key
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCacheSoftImpl.SoftHashMap

public ObjectCacheSoftImpl.SoftHashMap(int hardSize)
Construct a new hash map with the specified size

Parameters:
hardSize - the maximum capacity of this map
Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Put the key, value pair into the HashMap using a SoftValue object

Parameters:
key - the key
value - the value
Returns:
the old value

get

public java.lang.Object get(java.lang.Object key)
Retrieve the value associated to a given key

Parameters:
key - the key
Returns:
the value associated to this key

remove

public java.lang.Object remove(java.lang.Object key)
Remove the entry for this key

Parameters:
key - the key
Returns:
the old value

clear

public void clear()
Clear the map



(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30