|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.index.tree.IndexTree<N,E>
N
- the type of Node used in the indexE
- the type of Entry used in the indexpublic abstract class IndexTree<N extends Node<E>,E extends Entry>
Abstract super class for all tree based index classes.
Field Summary | |
---|---|
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. |
private PageFile<N> |
file
The file storing the entries of this 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. |
private E |
rootEntry
The entry representing the root node. |
Constructor Summary | |
---|---|
IndexTree(PageFile<N> pagefile)
Constructor. |
Method Summary | |
---|---|
protected abstract void |
createEmptyRoot(E exampleLeaf)
Creates an empty root node and writes it to file. |
protected TreeIndexHeader |
createHeader()
Creates a header for this index structure which is an instance of TreeIndexHeader . |
protected abstract N |
createNewDirectoryNode()
Creates a new directory node with the specified capacity. |
protected abstract N |
createNewLeafNode()
Creates a new leaf node with the specified capacity. |
protected abstract E |
createRootEntry()
Creates an entry representing the root node. |
protected void |
deleteNode(N node)
Delete a node from the backing storage. |
protected PageFile<N> |
getFile()
Deprecated. |
protected abstract Logging |
getLogger()
Get the (STATIC) logger for this class. |
N |
getNode(E entry)
Returns the node that is represented by the specified entry. |
N |
getNode(Integer nodeID)
Returns the node with the specified id. |
PageFileStatistics |
getPageFileStatistics()
Get the index file page access statistics. |
protected Integer |
getPageID(Entry entry)
Convert a directory entry to its page id. |
protected int |
getPageSize()
Get the page size of the backing storage. |
N |
getRoot()
Reads the root node of this index from the file. |
E |
getRootEntry()
Returns the entry representing the root if this index. |
Integer |
getRootID()
Page ID of the root entry. |
IndexTreePath<E> |
getRootPath()
Returns the path to the root of this tree. |
void |
initialize()
Initialize the tree if the page file already existed. |
protected void |
initialize(E exampleLeaf)
Initializes the index. |
protected abstract void |
initializeCapacities(E exampleLeaf)
Determines the maximum and minimum number of entries in a node. |
void |
initializeFromFile(TreeIndexHeader header,
PageFile<N> file)
Initializes this index from an existing persistent file. |
protected boolean |
isRoot(N page)
Test if a given ID is the root. |
protected void |
postDelete(E entry)
Performs necessary operations after deleting the specified entry. |
protected void |
preInsert(E entry)
Performs necessary operations before inserting the specified entry. |
protected void |
writeNode(N node)
Write a node to the backing storage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final PageFile<N extends Node<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 IndexTree(PageFile<N> pagefile)
pagefile
- page file to useMethod Detail |
---|
public void initialize()
protected abstract Logging getLogger()
public final E getRootEntry()
public final Integer getRootID()
public N getRoot()
protected boolean isRoot(N page)
page
- Page to test
protected Integer getPageID(Entry entry)
entry
- Entry
public N getNode(Integer 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 void writeNode(N node)
node
- Node to writeprotected void deleteNode(N node)
node
- Node to deleteprotected TreeIndexHeader createHeader()
TreeIndexHeader
. Subclasses may need to overwrite this method if
they need a more specialized header.
public void initializeFromFile(TreeIndexHeader header, PageFile<N> file)
protected final void initialize(E exampleLeaf)
exampleLeaf
- an object that will be stored in the indexpublic final IndexTreePath<E> getRootPath()
protected abstract void initializeCapacities(E exampleLeaf)
exampleLeaf
- an object that will be stored in the indexprotected abstract void createEmptyRoot(E exampleLeaf)
exampleLeaf
- an object that will be stored in the indexprotected abstract E createRootEntry()
protected abstract N createNewLeafNode()
protected abstract N createNewDirectoryNode()
protected void preInsert(E entry)
entry
- the entry to be insertedprotected void postDelete(E entry)
entry
- the entry that was removedpublic PageFileStatistics getPageFileStatistics()
protected int getPageSize()
@Deprecated protected PageFile<N> getFile()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |