edu.gwu.algtest
Class MultiwayNode

java.lang.Object
  |
  +--edu.gwu.algtest.MultiwayNode

public class MultiwayNode
extends java.lang.Object

An instance of class MultiwayNode is to be used for each node in a Multiway tree. This class is already defined the edu.gwu.algtest package. Thus, you only need to create instances to use. Each instance has public fields for the various components of a node - see below.


Field Summary
 MultiwayNode[] children
          The array of child pointers, to be used in non-leaf nodes.
 edu.gwu.algtest.ComparableKeyValuePair[] data
          The array of data.
 int ID
          This is simply a unique ID assigned to each instance to help in debugging.
 boolean leaf
          Set this to true if the node is a leaf, false if not a leaf.
 int numEntries
          Store the current number of data entries in the node.
 
Constructor Summary
MultiwayNode(int degree)
           
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public int ID
This is simply a unique ID assigned to each instance to help in debugging.

leaf

public boolean leaf
Set this to true if the node is a leaf, false if not a leaf.

numEntries

public int numEntries
Store the current number of data entries in the node.

data

public edu.gwu.algtest.ComparableKeyValuePair[] data
The array of data. When creating an instance of the class, space is created for 2*degree-1 key-value pairs, as in:
    data = new ComparableKeyValuePair [2*degree-1];
 
You need to actually create the key-value pair instances to assign them here.

children

public MultiwayNode[] children
The array of child pointers, to be used in non-leaf nodes. Space is created for 2*degree pointers.
Constructor Detail

MultiwayNode

public MultiwayNode(int degree)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object