jdbm.btree
Class BTreeSortedMap<K,V>

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

public class BTreeSortedMap<K,V>
extends AbstractPrimaryMap<K,V>
implements PrimaryTreeMap<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
BTreeSortedMap(BTree<K,V> tree, boolean readonly)
           
 
Method Summary
 void addRecordListener(RecordListener<K,V> listener)
          add RecordListener which is notified about record changes
 void clear()
           
 java.util.Comparator<? super K> comparator()
           
 boolean containsKey(java.lang.Object key)
           
 java.util.Set<java.util.Map.Entry<K,V>> entrySet()
           
 K firstKey()
           
 V get(java.lang.Object key)
           
 RecordManager getRecordManager()
           
 BTree<K,V> getTree()
           
 java.util.SortedMap<K,V> headMap(K toKey)
           
 boolean inBounds(K e)
           
 K lastKey()
           
 java.lang.Integer newIntegerKey()
          In case primary key is Integer, new unique Key is generated, otherwise exception is thrown
 java.lang.Long newLongKey()
          In case primary key is Long, new unique Key is generated, otherwise exception is thrown
 V put(K key, V value)
           
 V remove(java.lang.Object key)
           
 void removeRecordListener(RecordListener<K,V> listener)
          remove RecordListener which is notified about record changes
 java.util.SortedMap<K,V> subMap(K fromKey, K toKey)
           
 java.util.SortedMap<K,V> tailMap(K fromKey)
           
 
Methods inherited from class jdbm.helper.AbstractPrimaryMap
find, inverseHashView, secondaryHashMap, secondaryHashMap, secondaryHashMapManyToOne, secondaryHashMapManyToOne, secondaryTreeMap, secondaryTreeMap, secondaryTreeMap, secondaryTreeMap, secondaryTreeMapManyToOne, secondaryTreeMapManyToOne, secondaryTreeMapManyToOne, secondaryTreeMapManyToOne
 
Methods inherited from class java.util.AbstractMap
containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdbm.PrimaryMap
inverseHashView, secondaryHashMap, secondaryHashMap, secondaryHashMapManyToOne, secondaryHashMapManyToOne, secondaryTreeMap, secondaryTreeMap, secondaryTreeMap, secondaryTreeMap, secondaryTreeMapManyToOne, secondaryTreeMapManyToOne, secondaryTreeMapManyToOne, secondaryTreeMapManyToOne
 
Methods inherited from interface jdbm.helper.JdbmBase
find
 
Methods inherited from interface java.util.SortedMap
keySet, values
 
Methods inherited from interface java.util.Map
containsValue, equals, hashCode, isEmpty, putAll, size
 

Constructor Detail

BTreeSortedMap

public BTreeSortedMap(BTree<K,V> tree,
                      boolean readonly)
Method Detail

entrySet

public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface java.util.Map<K,V>
Specified by:
entrySet in interface java.util.SortedMap<K,V>
Specified by:
entrySet in class java.util.AbstractMap<K,V>

inBounds

public boolean inBounds(K e)

get

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

remove

public V remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<K,V>
Overrides:
remove in class java.util.AbstractMap<K,V>

put

public V put(K key,
             V value)
Specified by:
put in interface java.util.Map<K,V>
Overrides:
put in class java.util.AbstractMap<K,V>

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<K,V>
Overrides:
containsKey in class java.util.AbstractMap<K,V>

comparator

public java.util.Comparator<? super K> comparator()
Specified by:
comparator in interface java.util.SortedMap<K,V>

firstKey

public K firstKey()
Specified by:
firstKey in interface java.util.SortedMap<K,V>

lastKey

public K lastKey()
Specified by:
lastKey in interface java.util.SortedMap<K,V>

headMap

public java.util.SortedMap<K,V> headMap(K toKey)
Specified by:
headMap in interface java.util.SortedMap<K,V>

subMap

public java.util.SortedMap<K,V> subMap(K fromKey,
                                       K toKey)
Specified by:
subMap in interface java.util.SortedMap<K,V>

tailMap

public java.util.SortedMap<K,V> tailMap(K fromKey)
Specified by:
tailMap in interface java.util.SortedMap<K,V>

getTree

public BTree<K,V> getTree()

addRecordListener

public void addRecordListener(RecordListener<K,V> listener)
Description copied from interface: JdbmBase
add RecordListener which is notified about record changes

Specified by:
addRecordListener in interface JdbmBase<K,V>

getRecordManager

public RecordManager getRecordManager()
Specified by:
getRecordManager in interface JdbmBase<K,V>
Returns:
underlying record manager

removeRecordListener

public void removeRecordListener(RecordListener<K,V> listener)
Description copied from interface: JdbmBase
remove RecordListener which is notified about record changes

Specified by:
removeRecordListener in interface JdbmBase<K,V>

newIntegerKey

public java.lang.Integer newIntegerKey()
Description copied from interface: PrimaryTreeMap
In case primary key is Integer, new unique Key is generated, otherwise exception is thrown

Specified by:
newIntegerKey in interface PrimaryTreeMap<K,V>

newLongKey

public java.lang.Long newLongKey()
Description copied from interface: PrimaryTreeMap
In case primary key is Long, new unique Key is generated, otherwise exception is thrown

Specified by:
newLongKey in interface PrimaryTreeMap<K,V>

clear

public void clear()
Specified by:
clear in interface java.util.Map<K,V>
Overrides:
clear in class java.util.AbstractMap<K,V>


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