net.ontopia.utils
Class HashMapIndex<K,E>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,E>
          extended by net.ontopia.utils.HashMapIndex<K,E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,E>, LookupIndexIF<K,E>

public class HashMapIndex<K,E>
extends java.util.HashMap<K,E>
implements LookupIndexIF<K,E>

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

See Also:
Serialized Form

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<K,E> fallback
           
 
Constructor Summary
HashMapIndex()
           
HashMapIndex(LookupIndexIF<K,E> fallback)
           
HashMapIndex(java.util.Map<K,E> map)
           
HashMapIndex(java.util.Map<K,E> map, LookupIndexIF<K,E> fallback)
           
 
Method Summary
 E get(java.lang.Object key)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
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<K,E> fallback
Constructor Detail

HashMapIndex

public HashMapIndex()

HashMapIndex

public HashMapIndex(java.util.Map<K,E> map)

HashMapIndex

public HashMapIndex(LookupIndexIF<K,E> fallback)

HashMapIndex

public HashMapIndex(java.util.Map<K,E> map,
                    LookupIndexIF<K,E> fallback)
Method Detail

get

public E get(java.lang.Object key)
Specified by:
get in interface java.util.Map<K,E>
Specified by:
get in interface LookupIndexIF<K,E>
Overrides:
get in class java.util.HashMap<K,E>


Copyright © 2000-2012 Ontopia.