com.mapinfo.midev.index.rtree

## Class RamBasedHelper

- java.lang.Object
- - com.mapinfo.midev.index.rtree.RamBasedHelper

All Implemented Interfaces:
  IRTreeHelper

    public class RamBasedHelper
    extends Object
    implements IRTreeHelper

Simple helper where all nodes are maintained in RAM.

### Constructor Summary

Constructors
Constructor and Description
`RamBasedHelper(int maxCapacity, int minCapacity)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clear()` Clears the tree of all contents.
`IRTreeNode` `createNode()` Creates a new node for the tree.
`void` `deleteNode(IRTreeNode node)` Removes a node from the tree when it is no longer needed.
`int` `getMaxNodeCapacity()` Returns the maximum number of children a node may have.
`int` `getMinNodeCapacity()` Returns the minimum number of children a node may have.
`IRTreeNode` `getRootNode()` Returns the root node of the RTree.
`void` `setAsRootNode(IRTreeNode node)` Changes the root node of the tree.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RamBasedHelper

    public RamBasedHelper(int maxCapacity,
                          int minCapacity)

### Method Detail

#### getRootNode

    public IRTreeNode getRootNode()

Description copied from interface: `IRTreeHelper`
Returns the root node of the RTree.

Specified by:
  `getRootNode` in interface `IRTreeHelper`
Returns:
  the root node of the RTree.

#### setAsRootNode

    public void setAsRootNode(IRTreeNode node)

Description copied from interface: `IRTreeHelper`
Changes the root node of the tree.

Specified by:
  `setAsRootNode` in interface `IRTreeHelper`
Parameters:
  `node` - The node that should be the new root of the tree.

#### createNode

    public IRTreeNode createNode()

Description copied from interface: `IRTreeHelper`
Creates a new node for the tree.

Specified by:
  `createNode` in interface `IRTreeHelper`
Returns:
  a new node for the tree.

#### deleteNode

    public void deleteNode(IRTreeNode node)

Description copied from interface: `IRTreeHelper`
Removes a node from the tree when it is no longer needed. This call does not alter the children of the deleted node or the the parent of the deleted node. Alterations in the structure of the tree must be made on the node objects themselves.

Specified by:
  `deleteNode` in interface `IRTreeHelper`
Parameters:
  `node` - The node to remove.

#### getMinNodeCapacity

    public int getMinNodeCapacity()

Description copied from interface: `IRTreeHelper`
Returns the minimum number of children a node may have.

Specified by:
  `getMinNodeCapacity` in interface `IRTreeHelper`
Returns:
  The minimum number of children a node may have.

#### clear

    public void clear()

Description copied from interface: `IRTreeHelper`
Clears the tree of all contents.

Specified by:
  `clear` in interface `IRTreeHelper`

#### getMaxNodeCapacity

    public int getMaxNodeCapacity()

Description copied from interface: `IRTreeHelper`
Returns the maximum number of children a node may have.

Specified by:
  `getMaxNodeCapacity` in interface `IRTreeHelper`
Returns:
  The maximum number of children a node may have.