Lab 9: Auto Complete

Commit 8 - Ordered List stubs

Due end of class Tuesday Week 10

Build on Lab 7

Begin by incorporating your instructor's feedback from lab 7 and build on that IntelliJ project.

Unordered List Implementation

Update your UnorderedList implementation from lab 7 to incorporate feedback from your instructor, if available. Use this implementation as one of the AutoCompleter interface implementations.

Ordered List Stubs

Create an OrderedList class that implements the AutoCompleter interface and stub out all of the required methods.

Commit 9 - GUI Skeleton

Due end of class Tuesday Week 10

Assignment

Your program must have a user interface similar to the one shown here.

Auto Complete UI
Figure 1: Auto Complete UI

Create the FXML file to produce a UI that matches the figure above. In addition, create a class called AutoComplete that serves as the main entry point for the program and stub out the Controller class so that the non-functional UI can be displayed.

Commit 10 - Ordered List Functionality

Due end of class Wednesday Week 10

Ordered List Implementation

Implement the OrderedList class. The class must have at least the following private attribute: private final List<String> items that is assigned via a one-argument constructor. You should ensure that the list does not contain duplicates and that all of the items are in order.

Your implementation of add() must use a list iterator to iterate through the list to find the position where the element to be added should be inserted such that the order of the list is maintained.

You must make use of one call to Collections.binarySearch() in your implementations of exactMatch() and allMatches().

Commit 11 - Binary Search Tree Functionality

Due end of class Thursday Week 10

Binary Search Tree Implementation

Implement the AutoCompleter interface using a binary search tree. Your class, BinarySearchTree, must have only one private attribute: private final TreeSet<String> items. Note: getBackingClass() should return java.util.TreeSet.

Commit 12 - Lab completed

Due 11pm Monday Week 11

Testing

Update your JUnit test class for the AutoCompleter interface from lab 7 to test your OrderedList and BinarySearchTree implementations of the AutoCompleter interface and make any needed changes.

GUI Functionality

Users may type characters into search box. The list of matches below must be shown immediately after a letter is typed or deleted. In addition, the time required to find an exact match and all matches with the same prefix should be displayed in appropriate text boxes for both the sorted list and unsorted list data structures.

There are several word list files available in the data folder of the repository. Your program should provide a mechanism for the user to specify the word list file to be used. This can be via a command line argument or a mechanism in the graphical user interface.

Efficient Implementations

Your implementations should provide the best \( O() \) performance you can. You may want to analyze the asymptotic time complexity for your implementations. If you do, preserve your notes, since you will be required to provide this analysis in a future lab assignment.

Exception Handling

If any problems are encountered with reading the input file with the word list, the program should display a useful error message to the console and terminate gracefully. If any other exceptions occur once the GUI has been displayed, the program should display a meaningful Alert and recover appropriately. The program should not crash or display any exceptions.

Just For Fun

Ambitious students may wish to:

Acknowledgement

This laboratory assignment, developed by Dr. Chris Taylor.