Class FlatRStarTree
- java.lang.Object
-
- elki.index.tree.IndexTree<N,E>
-
- elki.index.tree.spatial.rstarvariants.AbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>
-
- elki.index.tree.spatial.rstarvariants.flat.FlatRStarTree
-
- All Implemented Interfaces:
elki.index.Index
- Direct Known Subclasses:
FlatRStarTreeIndex
public abstract class FlatRStarTree extends AbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>
FlatRTree is a spatial index structure based on a R*-Tree but with a flat directory. Apart from organizing the objects it also provides several methods to search for certain object in the structure and ensures persistence.- Since:
- 0.7.0
- Author:
- Elke Achtert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
AbstractRStarTree.Statistics
-
-
Field Summary
Fields Modifier and Type Field Description private static elki.logging.LoggingLOGThe logger for this class.private FlatRStarTreeNoderootThe root of this flat RTree.-
Fields inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
EXTRA_INTEGRITY_CHECKS, height, settings, statistics
-
-
Constructor Summary
Constructors Constructor Description FlatRStarTree(elki.persistent.PageFile<FlatRStarTreeNode> pagefile, RTreeSettings settings)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbulkLoad(java.util.List<SpatialEntry> spatialObjects)Performs a bulk load on this RTree with the specified data.protected intcomputeHeight()Computes the height of this RTree.protected voidcreateEmptyRoot(SpatialEntry exampleLeaf)protected SpatialEntrycreateNewDirectoryEntry(FlatRStarTreeNode node)Creates a new directory entry representing the specified node.protected FlatRStarTreeNodecreateNewDirectoryNode()protected FlatRStarTreeNodecreateNewLeafNode()protected SpatialEntrycreateRootEntry()protected elki.logging.LogginggetLogger()FlatRStarTreeNodegetNode(int nodeID)protected booleanhasOverflow(FlatRStarTreeNode node)Returns true if in the specified node an overflow occurred, false otherwise.protected booleanhasUnderflow(FlatRStarTreeNode node)Returns true if in the specified node an underflow occurred, false otherwise.voidinitializeFromFile(elki.index.tree.TreeIndexHeader header, elki.persistent.PageFile<FlatRStarTreeNode> file)Initializes this R*-Tree from an existing persistent file.-
Methods inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
adjustTree, canBulkLoad, choosePath, containedTest, createBulkLeafNodes, createNewRoot, deletePath, doExtraIntegrityChecks, findPathToObject, getHeight, getLeaves, initializeCapacities, insertEntry, insertLeaf, logStatistics, reInsert, setHeight, toString
-
-
-
-
Field Detail
-
LOG
private static final elki.logging.Logging LOG
The logger for this class.
-
root
private FlatRStarTreeNode root
The root of this flat RTree.
-
-
Constructor Detail
-
FlatRStarTree
public FlatRStarTree(elki.persistent.PageFile<FlatRStarTreeNode> pagefile, RTreeSettings settings)
Constructor.- Parameters:
pagefile- Page filesettings- Tree settings
-
-
Method Detail
-
initializeFromFile
public void initializeFromFile(elki.index.tree.TreeIndexHeader header, elki.persistent.PageFile<FlatRStarTreeNode> file)Description copied from class:AbstractRStarTreeInitializes this R*-Tree from an existing persistent file.- Overrides:
initializeFromFilein classAbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>
-
getNode
public FlatRStarTreeNode getNode(int nodeID)
- Overrides:
getNodein classelki.index.tree.IndexTree<FlatRStarTreeNode,SpatialEntry>
-
computeHeight
protected int computeHeight()
Description copied from class:AbstractRStarTreeComputes the height of this RTree. Is called by the constructor.- Specified by:
computeHeightin classAbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>- Returns:
- the height of this RTree
-
bulkLoad
protected void bulkLoad(java.util.List<SpatialEntry> spatialObjects)
Performs a bulk load on this RTree with the specified data. Is called by the constructor and should be overwritten by subclasses if necessary.- Specified by:
bulkLoadin classAbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>- Parameters:
spatialObjects- Entries to bulk load
-
createEmptyRoot
protected void createEmptyRoot(SpatialEntry exampleLeaf)
- Specified by:
createEmptyRootin classelki.index.tree.IndexTree<FlatRStarTreeNode,SpatialEntry>
-
hasOverflow
protected boolean hasOverflow(FlatRStarTreeNode node)
Description copied from class:AbstractRStarTreeReturns true if in the specified node an overflow occurred, false otherwise.- Specified by:
hasOverflowin classAbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>- Parameters:
node- the node to be tested for overflow- Returns:
- true if in the specified node an overflow occurred, false otherwise
-
hasUnderflow
protected boolean hasUnderflow(FlatRStarTreeNode node)
Description copied from class:AbstractRStarTreeReturns true if in the specified node an underflow occurred, false otherwise.- Specified by:
hasUnderflowin classAbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>- Parameters:
node- the node to be tested for underflow- Returns:
- true if in the specified node an underflow occurred, false otherwise
-
createNewLeafNode
protected FlatRStarTreeNode createNewLeafNode()
- Specified by:
createNewLeafNodein classelki.index.tree.IndexTree<FlatRStarTreeNode,SpatialEntry>
-
createNewDirectoryNode
protected FlatRStarTreeNode createNewDirectoryNode()
- Specified by:
createNewDirectoryNodein classelki.index.tree.IndexTree<FlatRStarTreeNode,SpatialEntry>
-
createNewDirectoryEntry
protected SpatialEntry createNewDirectoryEntry(FlatRStarTreeNode node)
Description copied from class:AbstractRStarTreeCreates a new directory entry representing the specified node.- Specified by:
createNewDirectoryEntryin classAbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>- Parameters:
node- the node to be represented by the new entry- Returns:
- the newly created directory entry
-
createRootEntry
protected SpatialEntry createRootEntry()
- Specified by:
createRootEntryin classelki.index.tree.IndexTree<FlatRStarTreeNode,SpatialEntry>
-
getLogger
protected elki.logging.Logging getLogger()
- Specified by:
getLoggerin classelki.index.tree.IndexTree<FlatRStarTreeNode,SpatialEntry>
-
-