Class SoftHashMap.SoftValue
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.SoftReference
-
- org.onemind.commons.java.lang.ref.SoftHashMap.SoftValue
-
- Enclosing class:
- SoftHashMap
private static class SoftHashMap.SoftValue extends java.lang.ref.SoftReference
We define our own subclass of SoftReference which contains not only the value but also the key to make it easier to find the entry in the HashMap after it's been garbage collected.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
key
-
Constructor Summary
Constructors Modifier Constructor Description private
SoftValue(java.lang.Object k, java.lang.Object key, java.lang.ref.ReferenceQueue q)
Did you know that an outer class can access private data members and methods of an inner class? I didn't know that! I thought it was only the inner class who could access the outer class's private information.
-
-
-
Constructor Detail
-
SoftValue
private SoftValue(java.lang.Object k, java.lang.Object key, java.lang.ref.ReferenceQueue q)
Did you know that an outer class can access private data members and methods of an inner class? I didn't know that! I thought it was only the inner class who could access the outer class's private information. An outer class can also access private members of an inner class inside its inner class.
-
-