CS 257: Software Design

Autocomplete, Phase 3 of 3

Continue with your partner, one more time.

For this assignment, you will complete an implementation of the Autocompleter class, along with a command-line application to give it a try, as described below.

The AutocompletereTest class from phase 2 time will be a big help, but you will now need to implement Autocompleter, add facilities for parsing the command line arguments, mechanisms for loading the actors.txt file into a suitable run-time data structure, etc. You'll add a main method to Autocompleter to enable you to run Autocompleter as an independent program (unlike with Phase 2, where you used the JUnit test infrastructure to instantiate objects and invoke methods).

Autocompleter's command-line syntax

java Autocompleter pathToActorsFile searchString

where pathToActorsFile is just the actors file name (if it's in the current directory) or the path to the actor's file if it's not, and searchString is the string that you want auto-completed. The result will be a sorted list of the matching actors' names.

Usage examples

For each of the following examples, assume we're using the full actors.txt file.

Notes

Handing it in

Submit your program by committing it to your GitHub repository and tagging it with a tag named "autocomplete_phase3".

Have fun!