net.ontopia.utils
Class WeakHashMapIndex

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.WeakHashMap
          extended by net.ontopia.utils.WeakHashMapIndex
All Implemented Interfaces:
java.util.Map, LookupIndexIF

public class WeakHashMapIndex
extends java.util.WeakHashMap
implements LookupIndexIF

INTERNAL: A lookup index that extends WeakHashMap. It forgets what it is told using put() at the will of the garbage collector, but will, if given a fallback object, ask the fallback for values it does not have.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
protected  LookupIndexIF fallback
           
 
Constructor Summary
WeakHashMapIndex()
           
WeakHashMapIndex(LookupIndexIF fallback)
           
WeakHashMapIndex(java.util.Map map)
           
WeakHashMapIndex(java.util.Map map, LookupIndexIF fallback)
           
 
Method Summary
 java.lang.Object get(java.lang.Object key)
           
 
Methods inherited from class java.util.WeakHashMap
clear, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.ontopia.utils.LookupIndexIF
put, remove
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

fallback

protected LookupIndexIF fallback
Constructor Detail

WeakHashMapIndex

public WeakHashMapIndex()

WeakHashMapIndex

public WeakHashMapIndex(java.util.Map map)

WeakHashMapIndex

public WeakHashMapIndex(LookupIndexIF fallback)

WeakHashMapIndex

public WeakHashMapIndex(java.util.Map map,
                        LookupIndexIF fallback)
Method Detail

get

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


Copyright © 2000-2012 Ontopia.