Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants
Class AbstractRStarTreeNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.persistent.AbstractPage<N>
          extended by de.lmu.ifi.dbs.elki.index.tree.AbstractNode<N,E>
              extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTreeNode<N,E>
All Implemented Interfaces:
Node<N,E>, SpatialComparable, SpatialNode<N,E>, SpatialObject, Loggable, Page<N>, Externalizable, Serializable
Direct Known Subclasses:
DeLiCluNode, RdKNNNode, RStarTreeNode

public abstract class AbstractRStarTreeNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>
extends AbstractNode<N,E>
implements SpatialNode<N,E>

Abstract superclass for nodes in a R*-Tree.

Author:
Elke Achtert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
AbstractRStarTreeNode()
          Empty constructor for Externalizable interface.
AbstractRStarTreeNode(PageFile<N> file, int capacity, boolean isLeaf)
          Creates a new AbstractRStarTreeNode with the specified parameters.
 
Method Summary
 void adjustEntry(E entry)
          Adjusts the parameters of the entry representing this node.
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.
 int getDimensionality()
          Returns the dimensionality of this spatial object.
 double getMax(int dimension)
          Returns the maximum coordinate at the specified dimension.
 double getMin(int dimension)
          Returns the minimum coordinate at the specified dimension.
protected
<D extends Distance<D>>
void
initReInsert(int start, DistanceEntry<D,E>[] reInsertEntries)
          Initializes a reinsert operation.
 HyperBoundingBox mbr()
          Computes and returns the MBR of this spatial object.
protected  N splitEntries(List<E> sorting, int splitPoint)
          Splits the entries of this node into a new node at the specified splitPoint and returns the newly created node.
 void test()
          Tests this node (for debugging purposes).
protected  void testEntry(N parent, int index)
          Tests, if the parameters of the entry representing this node, are correctly set.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractNode
addDirectoryEntry, addLeafEntry, children, deleteAllEntries, deleteEntry, equals, getCapacity, getEntries, getEntry, getNumEntries, increaseEntries, isLeaf, readExternal, toString, writeExternal
 
Methods inherited from class de.lmu.ifi.dbs.elki.persistent.AbstractPage
getFile, getID, hashCode, isDirty, setDirty, setFile, setID
 
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, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Node
addDirectoryEntry, addLeafEntry, children, getEntry, getNumEntries, isLeaf
 
Methods inherited from interface de.lmu.ifi.dbs.elki.persistent.Page
getID, isDirty, setDirty, setFile, setID
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialObject
getID
 

Constructor Detail

AbstractRStarTreeNode

public AbstractRStarTreeNode()
Empty constructor for Externalizable interface.


AbstractRStarTreeNode

public AbstractRStarTreeNode(PageFile<N> file,
                             int capacity,
                             boolean isLeaf)
Creates a new AbstractRStarTreeNode with the specified parameters.

Parameters:
file - the file storing the R*-Tree
capacity - the capacity (maximum number of entries plus 1 for overflow) of this node
isLeaf - indicates wether this node is a leaf node
Method Detail

getMin

public double getMin(int dimension)
Description copied from interface: SpatialComparable
Returns the minimum coordinate at the specified dimension.

Specified by:
getMin in interface SpatialComparable
Parameters:
dimension - the dimension for which the coordinate should be returned, where 1 ≤ dimension ≤ getDimensionality()
Returns:
the minimum coordinate at the specified dimension
See Also:
SpatialComparable.getMin(int)

getMax

public double getMax(int dimension)
Description copied from interface: SpatialComparable
Returns the maximum coordinate at the specified dimension.

Specified by:
getMax in interface SpatialComparable
Parameters:
dimension - the dimension for which the coordinate should be returned, where 1 ≤ dimension ≤ getDimensionality()
Returns:
the maximum coordinate at the specified dimension
See Also:
SpatialComparable.getMax(int)

mbr

public HyperBoundingBox mbr()
Description copied from interface: SpatialNode
Computes and returns the MBR of this spatial object.

Specified by:
mbr in interface SpatialNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>
Returns:
the MBR of this spatial object
See Also:
SpatialNode.mbr()

getDimensionality

public int getDimensionality()
Description copied from interface: SpatialNode
Returns the dimensionality of this spatial object.

Specified by:
getDimensionality in interface SpatialComparable
Specified by:
getDimensionality in interface SpatialNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>
Returns:
the dimensionality of this spatial object
See Also:
SpatialNode.getDimensionality()

adjustEntry

public void adjustEntry(E entry)
Adjusts the parameters of the entry representing this node.

Parameters:
entry - the entry representing this node

initReInsert

protected <D extends Distance<D>> void initReInsert(int start,
                                                    DistanceEntry<D,E>[] reInsertEntries)
Initializes a reinsert operation. Deletes all entries in this node and adds all entries from start index on to this node's children.

Parameters:
start - the start index of the entries that will be reinserted
reInsertEntries - the array of entries to be reinserted

splitEntries

protected N splitEntries(List<E> sorting,
                         int splitPoint)
Splits the entries of this node into a new node at the specified splitPoint and returns the newly created node.

Parameters:
sorting - the sorted entries of this node
splitPoint - the split point of the entries
Returns:
the newly created split node

test

public final void test()
Tests this node (for debugging purposes).


testEntry

protected void testEntry(N parent,
                         int index)
Tests, if the parameters of the entry representing this node, are correctly set. Subclasses may need to overwrite this method.

Parameters:
parent - the parent holding the entry representing this node
index - the index of the entry in the parents child arry

createNewLeafNode

protected abstract N createNewLeafNode(int capacity)
Creates a new leaf node with the specified capacity.

Specified by:
createNewLeafNode in class AbstractNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>
Parameters:
capacity - the capacity of the new node
Returns:
a new leaf node

createNewDirectoryNode

protected abstract N createNewDirectoryNode(int capacity)
Creates a new directory node with the specified capacity.

Specified by:
createNewDirectoryNode in class AbstractNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>
Parameters:
capacity - the capacity of the new node
Returns:
a new directory node

Release 0.1 (2008-07-10_1838)