For this assignment, you are to write a Java program that profiles a text file. Your program should read the name of the text file to be processed, then display the total number of words in that file, the number of unique words in the file, and a listing of all the words that appeared exactly once in the file. For example, suppose the file foo.txt contained the following text:
foo bar biz baz boo bar boo baz bingo bango bongo bingo
Your program should produce the following:
HINT 1: The first thing that you will need to be able to do is read strings from the console and also from a file. The EasyReader class is designed to make these tasks simple. You can create an EasyReader object and initialize it to standard input or a file. Then, there are methods defined for reading values of various types, such as stringInput and intInput. The method isEOF returns true if the end of file has been reached. For example,
HINT 2: In order to store the words as they are read in from the file, you should use an extended version of the LinkedList class discussed in lecture (which depends upon the ObjectNode class). As is, this class has methods for inserting an object into the front of the list and displaying the entire list. You will need to add the following methods:
Note that when you compare objects in Java, you should NOT use '=='. The '==' operator simply does a bit-by-bit comparison, which in the case of reference types compares addresses as opposed to the underlying data. Instead, you should use the equals method that is defined for objects. For example,
HINT 3: Using two LinkedLists, you can complete this assignment as follows: