net.ontopia.utils
Class SoftValueHashMapIndex
java.lang.Object
net.ontopia.utils.SoftValueHashMapIndex
- All Implemented Interfaces:
- LookupIndexIF
public class SoftValueHashMapIndex
- extends Object
- implements LookupIndexIF
INTERNAL: A lookup index implementation that uses soft references
for the values, in order to allow them to be garbage-collected. It
doesn't support a fallback, since this is not needed where it is
used. It's simply a cache that allows its values to be GC-ed. Note
that the keys passed in should not be SoftReferences; the index
will wrap them as references where needed.
General approach is closed hashing, like in CompactHashSet.
We simplify a little by assuming that null keys do not occur in
put() and remove().
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entries
public SoftValueHashMapIndex.SoftEntry[] entries
SoftValueHashMapIndex
public SoftValueHashMapIndex()
get
public Object get(Object key)
- Specified by:
get
in interface LookupIndexIF
getKey
public Object getKey(Object key)
put
public Object put(Object key,
Object value)
- Specified by:
put
in interface LookupIndexIF
remove
public Object remove(Object key)
- Specified by:
remove
in interface LookupIndexIF
size
public int size()
writeReport
public void writeReport(Writer out)
throws IOException
- Throws:
IOException
Copyright © 2000-2012 Ontopia.