-
You will be provided with a program shell consisting of an EMDirTest class containing a main method, the Name class that encapsulates a person’s name, and the EMDirectory class. All of the code development should appear in the EMDirectory class. Here are some of the specifications of the EMDirectory class.
-
The addEntry(Name name, String emailAddr)
method takes a name of type Name
and an email address, as a String, and stores them in the Map.
-
The lookup(Name name)
takes a Name
object as a key and returns the corresponding email address as a String
.
-
The lookupLastName(String lastName)
takes a last name, as a string, and returns a set of all email addresses stored with any name that has that last name.
-
The listAll()
displays the name and the email address for each item in the directory.
- A method to read the data file is provided.
-
The data file to be used in this lab is emdir.txt.
-
Modify and write code as necessary to satisfy the above specifications.
-
You will be provided with a sequence of operations to perform to test the class.
- Submit the source for the
EMDirectory
class along with the run output.