com.smartwerkz.jupload.classic.util
Class Cachetable

java.lang.Object
  extended by java.util.AbstractMap
      extended by com.smartwerkz.jupload.classic.util.Cachetable
All Implemented Interfaces:
java.io.Serializable, java.util.Map

public class Cachetable
extends java.util.AbstractMap
implements java.io.Serializable

A HashMap that contains SoftReferences for caching purposes. SoftReferences' referents will be automatically collected by the GC right before it runs out of memory in the order that they have been created in, if they don't have any strong references anymore.

Author:
Dominik Seifert
See Also:
http://www.roseindia.net/javatutorials/references.shtml, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
Cachetable()
           
Cachetable(int cap)
           
 
Method Summary
 void clear()
           
 java.util.Set entrySet()
          Returns a copy of the key/values in the map at the point of calling.
 java.lang.Object get(java.lang.Object key)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cachetable

public Cachetable()

Cachetable

public Cachetable(int cap)
Method Detail

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.AbstractMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.AbstractMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.AbstractMap

clear

public void clear()
Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.AbstractMap

size

public int size()
Specified by:
size in interface java.util.Map
Overrides:
size in class java.util.AbstractMap

entrySet

public java.util.Set entrySet()
Returns a copy of the key/values in the map at the point of calling. However, setStringValue still sets the value in the actual SoftHashMap.

Specified by:
entrySet in interface java.util.Map
Specified by:
entrySet in class java.util.AbstractMap


Copyright © 2007 smartwerkz.com. All Rights Reserved.