For this homework, you will create a FileIndex class that implements the ForwardIndex interface and provide missing default implementations in the ForwardIndex interface itself.

The ForwardIndex interface provides methods useful for any forward index that maps a generic location (like a file Path or webpage URL) to the words found at those locations.

The FileIndex class implements the interface to work specifically for text file Path locations and the unique words found at that location.

Motivation

Your search engine project will rely heavily on the underlying inverted index data structure used to store word stems, locations, and positions. Understanding how to utilize concepts like the use of generic types, interfaces, default implementations, and mutability in the design of a custom data structure is useful for refactoring your inverted index data structure (after you have a functional approach).

<aside> <img src="/icons/git_gray.svg" alt="/icons/git_gray.svg" width="40px" /> This homework assignment provides an example of the types of methods to include in a data structure class, which might be useful for your project. It is not necessary, however, to use interfaces or generic types in the project.

</aside>

Hints

Below are some hints that may help with this homework assignment:

These hints are optional. There may be multiple approaches to solving this homework.