Skip to content

Commit

Permalink
cleanup of btree interface
Browse files Browse the repository at this point in the history
  • Loading branch information
boiseamit committed Oct 22, 2024
1 parent e3992de commit 028db39
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/main/java/cs321/btree/BTreeInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public interface BTreeInterface {
*/
long getSize();


/**
* @return The degree of the BTree.
*/
Expand All @@ -28,15 +29,7 @@ public interface BTreeInterface {
*/
int getHeight();


/**
* Deletes a key from the BTree. Not Implemented.
*
* @param key the key to be deleted
*/
void delete(long key);



/**
*
* Insert a given sequence in the B-Tree. If the sequence already exists in the B-Tree,
Expand All @@ -49,24 +42,29 @@ public interface BTreeInterface {
*/
void insert(TreeObject obj) throws IOException;


/**
* Print out all objects in the given BTree in an inorder traversal to a file.
*
* @param out PrintWriter object representing output.
*/
void dumpToFile(PrintWriter out) throws IOException;


/**
* Dump out all objects in the given BTree in an inorder traversal to a table in the database.
*
* If the database does not exist, then it is created and the table is added.
*
* If the provided database already exists, then the table is added. If the table already exists,
* then the table is replaced.
* then the table is replaced.
*
* @param dbName String referring to the name of the database.
* @param tableName String referring to the table of the database.
*/
void dumpToDatabase(String dbName, String tableName) throws IOException;


/**
* Searches for a sequence in the given BTree.
*
Expand All @@ -75,4 +73,12 @@ public interface BTreeInterface {
*/
TreeObject search(long key) throws IOException;


/**
* Deletes a key from the BTree. Not Implemented.
*
* @param key the key to be deleted
*/
void delete(long key);

}

0 comments on commit 028db39

Please sign in to comment.