mtree
Class Node

java.lang.Object
  extended by mtree.Node
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
InternalNode, LeafNode

public abstract class Node
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Node(int level, NodeEntry parentNodeEntry)
          Constructors
 
Method Summary
protected abstract  boolean adjustParentHR()
          Adjusts the distances of HR array of the parent node.
protected abstract  boolean adjustParentRadius()
          Adjusts the radius of the parent node.
 void createRootNode()
          Creates a root from this node.
 int getLevel()
          Returns the level of this node.
abstract  int getObjectCount()
          Returns the number of stored objects in this node.
abstract  messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> getObjects()
          Returns an iterator of all objects stored in this node.
 InternalNode getParentNode()
          Returns the parent node of this node.
 NodeEntry getParentNodeEntry()
          Returns the parent node entry pointing to this node.
 float getParentRadius()
          Returns the covering radius of the parent node.
 java.util.List<messif.objects.LocalAbstractObject> getSortedObjectList()
          Returns a sorted list of all objects stored in this node.
abstract  boolean isCapacityExceeded()
          Returns false if the capacity of this node is not exceeded.
 boolean isLastInternalNode()
          Returns true if descendants of this node are leaves.
 boolean isLeaf()
          Returns true if this node is a leaf.
 boolean updateDistances()
          Adjusts the radius r and the distances of HR array of the parent node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(int level,
            NodeEntry parentNodeEntry)
Constructors

Method Detail

isCapacityExceeded

public abstract boolean isCapacityExceeded()
Returns false if the capacity of this node is not exceeded.

Returns:
false if the capacity of this node is not exceeded

getObjectCount

public abstract int getObjectCount()
Returns the number of stored objects in this node.

Returns:
the number of stored objects in this node

getObjects

public abstract messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> getObjects()
Returns an iterator of all objects stored in this node.

Returns:
an iterator of all objects stored in this node

adjustParentRadius

protected abstract boolean adjustParentRadius()
Adjusts the radius of the parent node.

Returns:
false if the radius of the parent node hasn't needed to be adjusted

adjustParentHR

protected abstract boolean adjustParentHR()
Adjusts the distances of HR array of the parent node.

Returns:
false if the distances of the parent node haven't needed to be adjusted

getLevel

public int getLevel()
Returns the level of this node.

Returns:
the level of this node

isLastInternalNode

public boolean isLastInternalNode()
Returns true if descendants of this node are leaves.

Returns:
true if descendants of this node are leaves

isLeaf

public boolean isLeaf()
Returns true if this node is a leaf.

Returns:
true if this node is a leaf

getParentNode

public InternalNode getParentNode()
Returns the parent node of this node.

Returns:
the parent node of this node (null in the case of root)

getParentNodeEntry

public NodeEntry getParentNodeEntry()
Returns the parent node entry pointing to this node.

Returns:
the parent node entry pointing to this node (null in the case of root)

createRootNode

public void createRootNode()
Creates a root from this node. Sets the parent node entry to null.


getParentRadius

public float getParentRadius()
Returns the covering radius of the parent node.

Returns:
the covering radius of the parent node (0 if the parent node does not exist)

updateDistances

public boolean updateDistances()
Adjusts the radius r and the distances of HR array of the parent node.

Returns:
false if the radius and the distances of HR array of the parent node haven't needed to be adjusted

getSortedObjectList

public java.util.List<messif.objects.LocalAbstractObject> getSortedObjectList()
Returns a sorted list of all objects stored in this node.

Returns:
a sorted list of all objects stored in this node (objects are sorted by the distance to their parent pivot (in descending manner)