For this homework assignment, you will create a class that stores words, and the positions those words were found. See the Javadoc comments in the WordIndex.java template code for additional details.
The following files are required for this project.
Please download the above files and add them to your Java project in Eclipse to get started.
The official name of this homework is WordIndex. This should be the name you use for your Eclipse Java project, the subdirectory used in your private GitHub homework repository, and the name you use when running the homework test script.
You must pass all unit tests when running the /home/public/cs212/homework script on the lab computers to receive a 100% on this homework assignment.
Below are some hints that may help with this homework assignment:
-
The Java Tutorials - Trail: Collections section will be useful for understanding different types of collections.
-
The
Collectionsclass has several helpful methods for this assignment. You might want to check out theaddAll()andunmodifiableSet()methods in particular. -
Most methods are under 5 lines of code (most of that will be
if/elseblocks), and involve calling the appropriateMaporSetmethods.
You are not required to use these hints in your solution. There may be multiple approaches to solving this homework.