de.lmu.ifi.dbs.elki.index.tree
Class TreeIndexFactory<O,I extends Index>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.TreeIndexFactory<O,I>
Type Parameters:
O - Object type
I - Index type
All Implemented Interfaces:
IndexFactory<O,I>, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
AbstractMTreeFactory, AbstractRStarTreeFactory

public abstract class TreeIndexFactory<O,I extends Index>
extends Object
implements IndexFactory<O,I>

Abstract base class for tree-based indexes.


Nested Class Summary
static class TreeIndexFactory.Parameterizer<O>
          Parameterization class.
 
Field Summary
static OptionID CACHE_SIZE_ID
          Parameter to specify the size of the cache in bytes, must be an integer equal to or greater than 0.
protected  long cacheSize
          Holds the value of CACHE_SIZE_ID.
static OptionID FILE_ID
          Optional parameter that specifies the name of the file storing the index.
protected  String fileName
          Holds the name of the file storing the index specified by FILE_ID, null if FILE_ID is not specified.
static OptionID PAGE_SIZE_ID
          Parameter to specify the size of a page in bytes, must be an integer greater than 0.
protected  int pageSize
          Holds the value of PAGE_SIZE_ID.
 
Constructor Summary
TreeIndexFactory(String fileName, int pageSize, long cacheSize)
          Constructor.
 
Method Summary
abstract  I instantiate(Relation<O> relation)
          Sets the database in the distance function of this index (if existing).
protected
<N extends Page>
PageFile<N>
makePageFile(Class<N> cls)
          Make the page file for this index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.IndexFactory
getInputTypeRestriction
 

Field Detail

FILE_ID

public static final OptionID FILE_ID
Optional parameter that specifies the name of the file storing the index. If this parameter is not set the index is hold in the main memory.

Key: -treeindex.file


PAGE_SIZE_ID

public static final OptionID PAGE_SIZE_ID
Parameter to specify the size of a page in bytes, must be an integer greater than 0.

Default value: 4000

Key: -treeindex.pagesize


CACHE_SIZE_ID

public static final OptionID CACHE_SIZE_ID
Parameter to specify the size of the cache in bytes, must be an integer equal to or greater than 0.

Default value: Integer.MAX_VALUE

Key: -treeindex.cachesize


fileName

protected String fileName
Holds the name of the file storing the index specified by FILE_ID, null if FILE_ID is not specified.


pageSize

protected int pageSize
Holds the value of PAGE_SIZE_ID.


cacheSize

protected long cacheSize
Holds the value of CACHE_SIZE_ID.

Constructor Detail

TreeIndexFactory

public TreeIndexFactory(String fileName,
                        int pageSize,
                        long cacheSize)
Constructor.

Parameters:
fileName -
pageSize -
cacheSize -
Method Detail

makePageFile

protected <N extends Page> PageFile<N> makePageFile(Class<N> cls)
Make the page file for this index.

Type Parameters:
N - page type
Parameters:
cls - Class information
Returns:
Page file

instantiate

public abstract I instantiate(Relation<O> relation)
Description copied from interface: IndexFactory
Sets the database in the distance function of this index (if existing).

Specified by:
instantiate in interface IndexFactory<O,I extends Index>
Parameters:
relation - the relation to index

Release 0.4.0 (2011-09-20_1324)