ru.biosoft.access
Class BTreeRangeIndex

java.lang.Object
  extended byjava.util.AbstractMap
      extended byru.biosoft.access.BTreeIndex
          extended byru.biosoft.access.BTreeRangeIndex
All Implemented Interfaces:
Index, java.util.Map

public class BTreeRangeIndex
extends BTreeIndex

Index for search keys by custom algorithm.

To do:
Use BTreeIndex for int keys, Optimize key/node iterator, Implement removing

Nested Class Summary
 
Nested classes inherited from class ru.biosoft.access.BTreeIndex
BTreeIndex.Block, BTreeIndex.IntKey, BTreeIndex.NodeKey
 
Nested classes inherited from class ru.biosoft.access.Index
Index.IndexEntry, Index.StringIndexEntry
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
 
Fields inherited from class ru.biosoft.access.BTreeIndex
currSize, DEFAULT_BLOCK_SIZE, indexFile, root, ROOT_BLOCK_OFFSET
 
Fields inherited from interface ru.biosoft.access.Index
DEFAULT_INDEX_NAME
 
Constructor Summary
BTreeRangeIndex(java.io.File dataFile, java.lang.String indexName, java.lang.String indexPath, int blockSize)
           
 
Method Summary
 java.lang.Object createNode(byte[] buffer, int pos)
           
 java.lang.Object createNode(byte[] buffer, int pos, java.lang.String key, Index.IndexEntry value)
           
 java.lang.Object get(java.lang.Object key)
          Returns the entry to which this index maps the specified key.
 java.util.Iterator keyIterator(Key key)
           
 java.util.Iterator nodeIterator(Key key)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object entry)
          Associates the specified entry with the specified key in this index.
 
Methods inherited from class ru.biosoft.access.BTreeIndex
clear, close, containsKey, entrySet, finalize, getBlock, getIndexFile, isValid, remove, size
 
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsValue, equals, hashCode, isEmpty, keySet, putAll, values
 

Constructor Detail

BTreeRangeIndex

public BTreeRangeIndex(java.io.File dataFile,
                       java.lang.String indexName,
                       java.lang.String indexPath,
                       int blockSize)
                throws java.io.IOException
Method Detail

createNode

public java.lang.Object createNode(byte[] buffer,
                                   int pos,
                                   java.lang.String key,
                                   Index.IndexEntry value)
Overrides:
createNode in class BTreeIndex

createNode

public java.lang.Object createNode(byte[] buffer,
                                   int pos)
Overrides:
createNode in class BTreeIndex

keyIterator

public java.util.Iterator keyIterator(Key key)
Overrides:
keyIterator in class BTreeIndex

nodeIterator

public java.util.Iterator nodeIterator(Key key)
Specified by:
nodeIterator in interface Index
Overrides:
nodeIterator in class BTreeIndex

get

public java.lang.Object get(java.lang.Object key)
Description copied from class: BTreeIndex
Returns the entry to which this index maps the specified key. Returns null if the index contains no entry for this key.

Specified by:
get in interface java.util.Map
Overrides:
get in class BTreeIndex
Parameters:
key - key whose associated entry is to be returned.
Returns:
the entry to which this index maps the specified key, or null if the index not contains entry for this key.
See Also:
Index.IndexEntry

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object entry)
Description copied from class: BTreeIndex
Associates the specified entry with the specified key in this index. If the index previously contained entry for this key, the old entry is replaced.

Specified by:
put in interface java.util.Map
Overrides:
put in class BTreeIndex
Parameters:
entry - entry to be associated with the specified key.
Returns:
previous entry associated with specified key, or null if there was no mapping for key.


Copyright © 2001-2003 Biosof.Ru. All Rights Reserved.