|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.index.tree.TreeIndex<O,N,E>
public abstract class TreeIndex<O extends DatabaseObject,N extends Node<N,E>,E extends Entry>
Abstract super class for all tree based index classes.
| Field Summary | |
|---|---|
static String |
CACHE_SIZE_D
Description for parameter cachesize. |
static String |
CACHE_SIZE_P
Option string for parameter cachesize. |
protected int |
cacheSize
The size of the cache in bytes. |
static int |
DEFAULT_CACHE_SIZE
The default cachesize. |
static int |
DEFAULT_PAGE_SIZE
The default pagesize. |
protected int |
dirCapacity
The capacity of a directory node (= 1 + maximum number of entries in a directory node). |
protected int |
dirMinimum
The minimum number of entries in a directory node. |
protected PageFile<N> |
file
The file storing the entries of this index. |
static String |
FILE_NAME_D
Description for parameter filename. |
static String |
FILE_NAME_P
Option string for parameter fileName. |
private String |
fileName
The name of the file for storing the index. |
protected boolean |
initialized
True if this index is already initialized. |
protected int |
leafCapacity
The capacity of a leaf node (= 1 + maximum number of entries in a leaf node). |
protected int |
leafMinimum
The minimum number of entries in a leaf node. |
static String |
PAGE_SIZE_D
Description for parameter filename. |
static String |
PAGE_SIZE_P
Option string for parameter pagesize. |
protected int |
pageSize
The size of a page in bytes. |
private E |
rootEntry
The entry representing the root node. |
| Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
|---|
optionHandler |
| Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debug |
| Constructor Summary | |
|---|---|
TreeIndex()
Sets parameters file, pageSize and cacheSize. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this index and the underlying file. |
protected abstract void |
createEmptyRoot(O object)
Creates an empty root node and writes it to file. |
protected TreeIndexHeader |
createHeader()
Creates a header for this index structure. |
protected abstract N |
createNewDirectoryNode(int capacity)
Creates a new directory node with the specified capacity. |
protected abstract N |
createNewLeafNode(int capacity)
Creates a new leaf node with the specified capacity. |
protected abstract E |
createRootEntry()
Creates an entry representing the root node. |
String |
description()
Returns a description of the class and the required parameters. |
long |
getLogicalPageAccess()
Returns the logical page access of this index. |
N |
getNode(E entry)
Returns the node that is represented by the specified entry. |
N |
getNode(int nodeID)
Returns the node with the specified id. |
long |
getPhysicalReadAccess()
Returns the physical read access of this index. |
long |
getPhysicalWriteAccess()
Returns the physical write access of this index. |
protected N |
getRoot()
Reads the root node of this index from the file. |
E |
getRootEntry()
Returns the entry representing the root if this index. |
protected TreeIndexPath<E> |
getRootPath()
Returns the path to the root of this tree. |
protected void |
initialize(O object)
Initializes the index. |
protected abstract void |
initializeCapacities(O object,
boolean verbose)
Determines the maximum and minimum number of entries in a node. |
protected void |
initializeFromFile()
Initializes this index from an existing persistent file. |
protected abstract void |
postDelete(O o)
Performs necessary operations after deleting the specified object. |
protected abstract void |
preInsert(E entry)
Performs necessary operations before inserting the specified entry. |
void |
resetPageAccess()
Resets the counters for page access. |
String[] |
setParameters(String[] args)
Sets the attributes of the class accordingly to the given parameters. |
| Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
|---|
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getAttributeSettings, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters |
| Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
| 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.Index |
|---|
delete, insert, insert, setDatabase |
| Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
|---|
checkGlobalParameterConstraints, getAttributeSettings, getParameters, getPossibleOptions, inlineDescription |
| Field Detail |
|---|
public static final String FILE_NAME_P
public static final String FILE_NAME_D
public static final int DEFAULT_PAGE_SIZE
public static final String PAGE_SIZE_P
public static final String PAGE_SIZE_D
public static final int DEFAULT_CACHE_SIZE
public static final String CACHE_SIZE_P
public static final String CACHE_SIZE_D
private String fileName
protected int pageSize
protected int cacheSize
protected PageFile<N extends Node<N,E>> file
protected boolean initialized
protected int dirCapacity
protected int leafCapacity
protected int dirMinimum
protected int leafMinimum
private E extends Entry rootEntry
| Constructor Detail |
|---|
public TreeIndex()
| Method Detail |
|---|
public String[] setParameters(String[] args)
throws ParameterException
Parameterizable
setParameters in interface ParameterizablesetParameters in class AbstractParameterizableargs - parameters to set the attributes accordingly to
ParameterException - in case of wrong parameter-settingParameterizable.setParameters(String[])public String description()
description in interface Parameterizabledescription in class AbstractParameterizableParameterizable.description()public final long getPhysicalReadAccess()
getPhysicalReadAccess in interface Index<O extends DatabaseObject>resetPageAccess.public final long getPhysicalWriteAccess()
getPhysicalWriteAccess in interface Index<O extends DatabaseObject>resetPageAccess.public final long getLogicalPageAccess()
getLogicalPageAccess in interface Index<O extends DatabaseObject>resetPageAccess.public final void resetPageAccess()
resetPageAccess in interface Index<O extends DatabaseObject>public final void close()
close in interface Index<O extends DatabaseObject>public final E getRootEntry()
public final N getNode(int nodeID)
nodeID - the page id of the node to be returned
public final N getNode(E entry)
entry - the entry representing the node to be returned
protected TreeIndexHeader createHeader()
protected void initializeFromFile()
protected final void initialize(O object)
object - an object that will be stored in the indexprotected final TreeIndexPath<E> getRootPath()
protected N getRoot()
protected abstract void initializeCapacities(O object,
boolean verbose)
object - an object that will be stored in the indexverbose - flag to allow verbose messagesprotected abstract void createEmptyRoot(O object)
object - an object that will be stored in the indexprotected abstract E createRootEntry()
protected abstract N createNewLeafNode(int capacity)
capacity - the capacity of the new node
protected abstract N createNewDirectoryNode(int capacity)
capacity - the capacity of the new node
protected abstract void preInsert(E entry)
entry - the entry to be insertedprotected abstract void postDelete(O o)
o - the object to be deleted
|
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||