public virtual void BuildIndex()
 {
     if (treeType == R_SHARP_TREE)
         throw new Exception("Tree type not yet implemented.");//TreeIndex = new R_Sharp_Tree();
     else if (treeType == FLASH_R_TREE_EXTENDED)
         TreeIndex = new Flash_R_Tree_Extended(SavedIndexFileLocation, Cache);
     else if (treeType == FLASH_R_TREE)
         TreeIndex = new Flash_R_Tree(SavedIndexFileLocation, Cache);
     else if (treeType == R_STAR_TREE)
         TreeIndex = new R_Star_Tree(SavedIndexFileLocation, Cache);
     else if (treeType == R_TREE)
         TreeIndex = new R_Tree(SavedIndexFileLocation, Cache);
     else throw new Exception("No such tree type.");
 }
 protected virtual void SelectTreeType()
 {
     if (treeType == R_SHARP_TREE)
         throw new Exception("Tree type not yet implemented.");//TreeIndex = new R_Sharp_Tree();
     else if (treeType == FLASH_R_TREE_EXTENDED)
         TreeIndex = new Flash_R_Tree_Extended(Cache, ReservationBufferSize * Constants.INDEX_UNIT_ENTRIES_PER_SECTOR);
     else if (treeType == FLASH_R_TREE)
         TreeIndex = new Flash_R_Tree(Cache, ReservationBufferSize*Constants.INDEX_UNIT_ENTRIES_PER_SECTOR);
     else if (treeType == R_STAR_TREE)
         TreeIndex = new R_Star_Tree(Cache);
     else if (treeType == R_TREE)
         TreeIndex = new R_Tree(Cache);
     else throw new Exception("No such tree type.");
 }