|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.util.ReferenceValueMap
org.jpox.util.SoftValueMap
A java.util.Map
implementation with soft values.
The values are stored as soft references. If map entry value object
is not actively being used, i.e. no other object has a strong reference
to it, it may become garbage collected at the discretion of the garbage
collector (typically if the VM is low on memory). If this happens, the
entry in the SoftValueMap
corresponding to the value object
will also be removed.
SoftReference
Nested Class Summary |
Nested classes inherited from class org.jpox.util.ReferenceValueMap |
ReferenceValueMap.ValueReference |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Constructor Summary | |
SoftValueMap()
Default Constructor |
|
SoftValueMap(int initialCapacity)
Constructor taking the initial capacity. |
|
SoftValueMap(int initialCapacity,
float loadFactor)
Constructor taking the initial capacity and load factor. |
|
SoftValueMap(java.util.Map m)
Constructor taking a Map for definition. |
Method Summary | |
protected ReferenceValueMap.ValueReference |
newValueReference(java.lang.Object key,
java.lang.Object value,
java.lang.ref.ReferenceQueue queue)
Returns a new Reference object to be inserted into the map. |
Methods inherited from class org.jpox.util.ReferenceValueMap |
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, reap, remove, size, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SoftValueMap()
public SoftValueMap(int initialCapacity)
initialCapacity
- The Initial capacity of the collectionpublic SoftValueMap(int initialCapacity, float loadFactor)
initialCapacity
- The Initial capacity of the collectionloadFactor
- The Load Factor of the collectionpublic SoftValueMap(java.util.Map m)
m
- The MapMethod Detail |
protected ReferenceValueMap.ValueReference newValueReference(java.lang.Object key, java.lang.Object value, java.lang.ref.ReferenceQueue queue)
ReferenceValueMap
Reference
object to be inserted into the map.
Subclasses must implement this method to construct Reference
objects of the desired type (e.g. SoftReference
, etc.).
newValueReference
in class ReferenceValueMap
key
- The key that will be inserted.value
- The associated value to be referenced.queue
- The ReferenceQueue
with which to register the
new Reference
object.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |