jdbm.helper
Class AbstractPrimaryMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by jdbm.helper.AbstractPrimaryMap<K,V>
All Implemented Interfaces:
java.util.Map<K,V>, JdbmBase<K,V>, PrimaryHashMap<K,V>, PrimaryMap<K,V>
Direct Known Subclasses:
BTreeSortedMap, HTreeMap, PrimaryStoreMapImpl

public abstract class AbstractPrimaryMap<K,V>
extends java.util.AbstractMap<K,V>
implements PrimaryHashMap<K,V>


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
AbstractPrimaryMap()
           
 
Method Summary
 V find(K k)
          Find Value for given Key
 InverseHashView<K,V> inverseHashView(java.lang.String objectName)
           
<A> SecondaryHashMap<A,K,V>
secondaryHashMap(java.lang.String objectName, SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor)
          Secondary hash view over this PrimaryMap.
<A> SecondaryHashMap<A,K,V>
secondaryHashMap(java.lang.String objectName, SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor, Serializer<A> secondaryKeySerializer)
           
<A> SecondaryHashMap<A,K,V>
secondaryHashMapManyToOne(java.lang.String objectName, SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor)
           
<A> SecondaryHashMap<A,K,V>
secondaryHashMapManyToOne(java.lang.String objectName, SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor, Serializer<A> secondaryKeySerializer)
           
<A extends java.lang.Comparable>
SecondaryTreeMap<A,K,V>
secondaryTreeMap(java.lang.String objectName, SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor)
           
<A> SecondaryTreeMap<A,K,V>
secondaryTreeMap(java.lang.String objectName, SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor, java.util.Comparator<A> secondaryKeyComparator)
           
<A> SecondaryTreeMap<A,K,V>
secondaryTreeMap(java.lang.String objectName, SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor, java.util.Comparator<A> secondaryKeyComparator, Serializer<A> secondaryKeySerializer)
           
<A extends java.lang.Comparable>
SecondaryTreeMap<A,K,V>
secondaryTreeMap(java.lang.String objectName, SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor, Serializer<A> secondaryKeySerializer)
           
<A extends java.lang.Comparable>
SecondaryTreeMap<A,K,V>
secondaryTreeMapManyToOne(java.lang.String objectName, SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor)
           
<A> SecondaryTreeMap<A,K,V>
secondaryTreeMapManyToOne(java.lang.String objectName, SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor, java.util.Comparator<A> secondaryKeyComparator)
           
<A> SecondaryTreeMap<A,K,V>
secondaryTreeMapManyToOne(java.lang.String objectName, SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor, java.util.Comparator<A> secondaryKeyComparator, Serializer<A> secondaryKeySerializer)
           
<A extends java.lang.Comparable>
SecondaryTreeMap<A,K,V>
secondaryTreeMapManyToOne(java.lang.String objectName, SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor, Serializer<A> secondaryKeySerializer)
           
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdbm.helper.JdbmBase
addRecordListener, getRecordManager, removeRecordListener
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

AbstractPrimaryMap

public AbstractPrimaryMap()
Method Detail

secondaryHashMap

public <A> SecondaryHashMap<A,K,V> secondaryHashMap(java.lang.String objectName,
                                                    SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor)
Description copied from interface: PrimaryMap
Secondary hash view over this PrimaryMap. It is readonly, is auto updated as PrimaryMaps is modified. View is indexed and persisted, so lookup is always fast

Specified by:
secondaryHashMap in interface PrimaryMap<K,V>
Type Parameters:
A - type of secondary key
Parameters:
objectName - under this name view will be stored in storage
secondaryKeyExtractor - extracts secondary key from primary map
Returns:
secondary map

secondaryTreeMap

public <A> SecondaryTreeMap<A,K,V> secondaryTreeMap(java.lang.String objectName,
                                                    SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor,
                                                    java.util.Comparator<A> secondaryKeyComparator)
Specified by:
secondaryTreeMap in interface PrimaryMap<K,V>

secondaryTreeMap

public <A extends java.lang.Comparable> SecondaryTreeMap<A,K,V> secondaryTreeMap(java.lang.String objectName,
                                                                                 SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor)
Specified by:
secondaryTreeMap in interface PrimaryMap<K,V>

secondaryHashMapManyToOne

public <A> SecondaryHashMap<A,K,V> secondaryHashMapManyToOne(java.lang.String objectName,
                                                             SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor)
Specified by:
secondaryHashMapManyToOne in interface PrimaryMap<K,V>

secondaryTreeMapManyToOne

public <A> SecondaryTreeMap<A,K,V> secondaryTreeMapManyToOne(java.lang.String objectName,
                                                             SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor,
                                                             java.util.Comparator<A> secondaryKeyComparator)
Specified by:
secondaryTreeMapManyToOne in interface PrimaryMap<K,V>

secondaryTreeMapManyToOne

public <A extends java.lang.Comparable> SecondaryTreeMap<A,K,V> secondaryTreeMapManyToOne(java.lang.String objectName,
                                                                                          SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor)
Specified by:
secondaryTreeMapManyToOne in interface PrimaryMap<K,V>

secondaryHashMap

public <A> SecondaryHashMap<A,K,V> secondaryHashMap(java.lang.String objectName,
                                                    SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor,
                                                    Serializer<A> secondaryKeySerializer)
Specified by:
secondaryHashMap in interface PrimaryMap<K,V>

secondaryTreeMap

public <A> SecondaryTreeMap<A,K,V> secondaryTreeMap(java.lang.String objectName,
                                                    SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor,
                                                    java.util.Comparator<A> secondaryKeyComparator,
                                                    Serializer<A> secondaryKeySerializer)
Specified by:
secondaryTreeMap in interface PrimaryMap<K,V>

secondaryTreeMap

public <A extends java.lang.Comparable> SecondaryTreeMap<A,K,V> secondaryTreeMap(java.lang.String objectName,
                                                                                 SecondaryKeyExtractor<A,K,V> secondaryKeyExtractor,
                                                                                 Serializer<A> secondaryKeySerializer)
Specified by:
secondaryTreeMap in interface PrimaryMap<K,V>

secondaryHashMapManyToOne

public <A> SecondaryHashMap<A,K,V> secondaryHashMapManyToOne(java.lang.String objectName,
                                                             SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor,
                                                             Serializer<A> secondaryKeySerializer)
Specified by:
secondaryHashMapManyToOne in interface PrimaryMap<K,V>

secondaryTreeMapManyToOne

public <A> SecondaryTreeMap<A,K,V> secondaryTreeMapManyToOne(java.lang.String objectName,
                                                             SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor,
                                                             java.util.Comparator<A> secondaryKeyComparator,
                                                             Serializer<A> secondaryKeySerializer)
Specified by:
secondaryTreeMapManyToOne in interface PrimaryMap<K,V>

secondaryTreeMapManyToOne

public <A extends java.lang.Comparable> SecondaryTreeMap<A,K,V> secondaryTreeMapManyToOne(java.lang.String objectName,
                                                                                          SecondaryKeyExtractor<java.lang.Iterable<A>,K,V> secondaryKeyExtractor,
                                                                                          Serializer<A> secondaryKeySerializer)
Specified by:
secondaryTreeMapManyToOne in interface PrimaryMap<K,V>

inverseHashView

public InverseHashView<K,V> inverseHashView(java.lang.String objectName)
Specified by:
inverseHashView in interface PrimaryMap<K,V>

find

public V find(K k)
       throws java.io.IOException
Description copied from interface: JdbmBase
Find Value for given Key

Specified by:
find in interface JdbmBase<K,V>
Parameters:
k - key
Returns:
value or null if not found
Throws:
java.io.IOException


Cees de Groot (C) 2000. All rights reserved http://jdbm.sourceforge.net