spatial
Interface RTreeStrategy

All Known Implementing Classes:
SimpleRTreeStrategy

public interface RTreeStrategy

Interface providing the operations which determine the strategy of an r-tree.


Method Summary
 int chooseSubtree(SpatialSearchTreeNode node, SpatialSearchTreeEntry obj)
          Determines the best subtree for inserting an new object.
 java.util.BitSet distribute(SpatialSearchTreeNode node, SpatialSearchTreeEntry entry)
          Distributes the entries of a node to two nodes.
 int getMinimum()
          Gets the minimum percentage of entries.
 int getReinsertFactor(int height)
          Returns the percentage of objects which should be reinserted.
 boolean isOrdering()
          Returns whether the strategy is ordering or not.
 void readParameters(java.io.DataInputStream in)
          Reads parameters from DataInputStream.
 void setMinimum(int m)
          Sets the minimum percentage of entries.
 void setReinsertFactor(int p)
          Sets the quota of entries to be reinserted.
 void sortForReinsert(SpatialSearchTreeNode node)
          Sorts the entries of the given node according to their distance to the center of the parent entry.
 void writeParameters(java.io.DataOutputStream out)
          Writes parameters to DataOutputStream.
 

Method Detail

chooseSubtree

public int chooseSubtree(SpatialSearchTreeNode node,
                         SpatialSearchTreeEntry obj)
Determines the best subtree for inserting an new object.

Parameters:
node - non-leaf node where the object should to be inserted
obj - the new object or the reinserted entry
Returns:
the index of the subtree

distribute

public java.util.BitSet distribute(SpatialSearchTreeNode node,
                                   SpatialSearchTreeEntry entry)
Distributes the entries of a node to two nodes.

Parameters:
node - the node
entry - the entry describing the node
Returns:
Bitset indicating the entries which should leave the node

getMinimum

public int getMinimum()
Gets the minimum percentage of entries.

Returns:
the percentage

getReinsertFactor

public int getReinsertFactor(int height)
Returns the percentage of objects which should be reinserted.

Returns:
the reinsert factor (0 = no reinsert)

isOrdering

public boolean isOrdering()
Returns whether the strategy is ordering or not.

Returns:
is ordering?

readParameters

public void readParameters(java.io.DataInputStream in)
                    throws java.io.IOException
Reads parameters from DataInputStream.

Parameters:
in - stream
Throws:
java.io.IOException

setMinimum

public void setMinimum(int m)
Sets the minimum percentage of entries.

Parameters:
m - the new value

setReinsertFactor

public void setReinsertFactor(int p)
Sets the quota of entries to be reinserted.

Parameters:
p - the new value

sortForReinsert

public void sortForReinsert(SpatialSearchTreeNode node)
Sorts the entries of the given node according to their distance to the center of the parent entry. The reinsert factor controls the number of exactly sorted entries. The object that should be reinserted are stored at the end of the node. The last entry should be reinserted first.

Parameters:
node - the node

writeParameters

public void writeParameters(java.io.DataOutputStream out)
                     throws java.io.IOException
Writes parameters to DataOutputStream.

Parameters:
out - stream
Throws:
java.io.IOException