|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--spatial.MemoryRTreeNode
A memory-based R-tree node.
| Nested Class Summary | |
protected class |
MemoryRTreeNode.MemoryRTreeEntry
Class representing an entry - required for calling strategy.distribute |
| Field Summary | |
protected SpatialSearchTreeEntry[] |
entry
the entries. |
protected boolean |
isLeaf
leaf flag. |
protected boolean |
isRoot
root flag. |
protected static int |
MAXENTRYNUM
maximum number of entries per node. |
protected MBR |
mbr
minimum bounding box. |
protected int |
num
number of entries. |
protected MemoryRTree |
tree
the tree of the node. |
| Constructor Summary | |
protected |
MemoryRTreeNode(boolean isLeaf,
MemoryRTree tree)
Internal constructor for new nodes which are not the root. |
protected |
MemoryRTreeNode(MemoryRTree tree)
Creates a new root which is also a leaf. |
protected |
MemoryRTreeNode(MemoryRTreeNode subtree1,
MemoryRTreeNode subtree2)
Internal constructor for a new root. |
| Method Summary | |
protected void |
adaptMBR()
Re-computes the mbr. |
int |
computeNumberOfEntries()
Returns the number of entries of the tree. |
int |
computeNumberOfNodes()
Returns the number of nodes of the tree. |
protected void |
debugPrint(int height,
boolean traverse)
Debug print of the tree. |
protected void |
draw(int actHeight,
java.awt.Graphics g,
int scale,
int minHeight,
int maxHeight)
Draws the subtree. |
SpatialSearchTreeNode |
getChildNode(int index)
Returns the child node of a non-leaf entry. |
SpatialSearchTreeEntry |
getEntry(int index)
Returns an entry in a node. |
MBR |
getEntryMBR(int index)
Returns the minimum bounding box of an entry in a node. |
int |
getHeight()
Returns the height of the tree. |
int |
getMaxNumberOfEntries()
Returns the maximum number of entries. |
MBR |
getMBR()
Returns the minimum bounding box. |
int |
getNumberOfEntries()
Returns the number of entries in the node. |
int |
getNumOfDimensions()
Returns the number of spatial dimensions. |
SpatialSearchTreeObject |
getObject(int index)
Returns the object of a leaf node. |
SpatialSearchTree |
getTree()
Returns the tree the node belongs to. |
MemoryRTreeNode |
insert(SpatialSearchTreeObject obj)
Inserts the object into the r-tree. |
protected void |
insertSimple(SpatialSearchTreeEntry obj)
Inserts the object into the node without handling of any special cases. |
boolean |
isLeaf()
Returns whether the node is a leaf or not. |
boolean |
isRoot()
Returns whether the node is a root node or not. |
boolean |
move(int index,
MBR newMBR)
Moves an object. |
boolean |
pointsToLeaf()
Returns whether the node points to a leaf or not. |
void |
removeObject(int index)
Removes the object with a given index. |
void |
resetLock()
Pseudo operation. |
void |
setEntry(SpatialSearchTreeEntry entry,
int i)
Sets the i-th entry of the node |
void |
setLock()
Pseudo operation. |
static void |
setMaximumCapacity(int capacity)
Sets the maximum capacity of the nodes. |
protected MemoryRTreeNode |
split()
Splits this node. |
void |
updateObject(int index)
Simulates an update of the object with a given index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static int MAXENTRYNUM
protected MemoryRTree tree
protected MBR mbr
protected SpatialSearchTreeEntry[] entry
protected int num
protected boolean isLeaf
protected boolean isRoot
| Constructor Detail |
protected MemoryRTreeNode(MemoryRTree tree)
tree - the memory r-tree
protected MemoryRTreeNode(MemoryRTreeNode subtree1,
MemoryRTreeNode subtree2)
subtree1 - first subtreesubtree2 - second subtree
protected MemoryRTreeNode(boolean isLeaf,
MemoryRTree tree)
tree - the memory r-tree| Method Detail |
protected void adaptMBR()
public int computeNumberOfEntries()
public int computeNumberOfNodes()
protected void debugPrint(int height,
boolean traverse)
height - height of the nodetraverse - traverse tree?
protected void draw(int actHeight,
java.awt.Graphics g,
int scale,
int minHeight,
int maxHeight)
actHeight - actual heightg - graphic contextscale - scaleminHeight - minimum heightmaxHeight - maximum heightpublic SpatialSearchTreeNode getChildNode(int index)
getChildNode in interface SpatialSearchTreeNodeindex - index of entry
public SpatialSearchTreeEntry getEntry(int index)
getEntry in interface SpatialSearchTreeNodeindex - index of the entry
public MBR getEntryMBR(int index)
getEntryMBR in interface SpatialSearchTreeNodeindex - index of entry
public int getHeight()
getHeight in interface SpatialSearchTreeNodepublic int getMaxNumberOfEntries()
getMaxNumberOfEntries in interface SpatialSearchTreeNodepublic MBR getMBR()
getMBR in interface SpatialSearchTreeEntrypublic int getNumOfDimensions()
getNumOfDimensions in interface SpatialSearchTreeEntrypublic int getNumberOfEntries()
getNumberOfEntries in interface SpatialSearchTreeNodepublic SpatialSearchTreeObject getObject(int index)
getObject in interface SpatialSearchTreeNodeindex - index of object
public SpatialSearchTree getTree()
getTree in interface SpatialSearchTreeNodepublic MemoryRTreeNode insert(SpatialSearchTreeObject obj)
obj - spatial searchtree object
protected void insertSimple(SpatialSearchTreeEntry obj)
obj - new spatial searchtree objectpublic boolean isLeaf()
isLeaf in interface SpatialSearchTreeNodepublic boolean isRoot()
isRoot in interface SpatialSearchTreeNode
public boolean move(int index,
MBR newMBR)
index - the index of the objectpublic boolean pointsToLeaf()
public void removeObject(int index)
removeObject in interface SpatialSearchTreeNodeindex - index of the objectpublic void resetLock()
resetLock in interface SpatialSearchTreeNode
public void setEntry(SpatialSearchTreeEntry entry,
int i)
setEntry in interface SpatialSearchTreeNodeentry - the new entryi - the indexpublic void setLock()
setLock in interface SpatialSearchTreeNodepublic static void setMaximumCapacity(int capacity)
capacity - the new capaciyprotected MemoryRTreeNode split()
public void updateObject(int index)
updateObject in interface SpatialSearchTreeNodeindex - index of the object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||