Class AbstractRStarTreeNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry>
- java.lang.Object
-
- elki.persistent.AbstractExternalizablePage
-
- elki.index.tree.AbstractNode<E>
-
- elki.index.tree.spatial.rstarvariants.AbstractRStarTreeNode<N,E>
-
- Type Parameters:
N
- Node typeE
- Entry type
- Direct Known Subclasses:
DeLiCluNode
,FlatRStarTreeNode
,RdKNNNode
,RStarTreeNode
public abstract class AbstractRStarTreeNode<N extends AbstractRStarTreeNode<N,E>,E extends SpatialEntry> extends AbstractNode<E> implements Node<E>
Abstract superclass for nodes in a R*-Tree.- Since:
- 0.1
- Author:
- Elke Achtert
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class elki.index.tree.AbstractNode
entries, isLeaf, numEntries
-
-
Constructor Summary
Constructors Constructor Description AbstractRStarTreeNode()
Empty constructor for Externalizable interface.AbstractRStarTreeNode(int capacity, boolean isLeaf)
Creates a new AbstractRStarTreeNode with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
adjustEntry(E entry)
Adjusts the parameters of the entry representing this node.boolean
adjustEntryIncremental(E entry, SpatialComparable responsibleMBR)
Adjusts the parameters of the entry representing this node.ModifiableHyperBoundingBox
computeMBR()
Recomputing the MBR is rather expensive.int
integrityCheck(AbstractRStarTree<N,E,?> tree)
Tests this node (public for debugging purposes).protected void
integrityCheckParameters(N parent, int index)
Tests, if the parameters of the entry representing this node, are correctly set.void
readExternal(java.io.ObjectInput in)
Reads the id of this node, the numEntries and the entries array from the specified stream.void
writeExternal(java.io.ObjectOutput out)
Calls the super method and writes the id of this node, the numEntries and the entries array to the specified stream.-
Methods inherited from class elki.index.tree.AbstractNode
addEntry, children, deleteAllEntries, deleteEntry, getCapacity, getEntry, getNumEntries, isLeaf, removeMask, splitByMask, splitTo, splitTo, toString
-
Methods inherited from class elki.persistent.AbstractExternalizablePage
equals, getPageID, hashCode, isDirty, setDirty, setPageID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
AbstractRStarTreeNode
public AbstractRStarTreeNode()
Empty constructor for Externalizable interface.
-
AbstractRStarTreeNode
public AbstractRStarTreeNode(int capacity, boolean isLeaf)
Creates a new AbstractRStarTreeNode with the specified parameters.- Parameters:
capacity
- the capacity (maximum number of entries plus 1 for overflow) of this nodeisLeaf
- indicates whether this node is a leaf node
-
-
Method Detail
-
computeMBR
public ModifiableHyperBoundingBox computeMBR()
Recomputing the MBR is rather expensive.- Returns:
- MBR
-
adjustEntry
public boolean adjustEntry(E entry)
Adjusts the parameters of the entry representing this node.- Parameters:
entry
- the entry representing this node
-
adjustEntryIncremental
public boolean adjustEntryIncremental(E entry, SpatialComparable responsibleMBR)
Adjusts the parameters of the entry representing this node. Only applicable if one object was inserted or the size of an existing node increased.- Parameters:
entry
- the entry representing this noderesponsibleMBR
- the MBR of the object or node which is responsible for the call of the method- Returns:
- true when the entry has changed
-
integrityCheck
public final int integrityCheck(AbstractRStarTree<N,E,?> tree)
Tests this node (public for debugging purposes).- Parameters:
tree
- Tree context- Returns:
- levels below
-
integrityCheckParameters
protected void integrityCheckParameters(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 nodeindex
- the index of the entry in the parents child array
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Calls the super method and writes the id of this node, the numEntries and the entries array to the specified stream.- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classAbstractNode<E extends SpatialEntry>
- Parameters:
out
- the stream to write the object to- Throws:
java.io.IOException
- Includes any I/O exceptions that may occur
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads the id of this node, the numEntries and the entries array from the specified stream.- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classAbstractNode<E extends SpatialEntry>
- Parameters:
in
- the stream to read data from in order to restore the object- Throws:
java.io.IOException
- if I/O errors occurjava.lang.ClassNotFoundException
- If the class for an object being restored cannot be found.
-
-