public class UseBufferedReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.BufferedReader |
input
This is the BufferedReader object that will allow us to read in the
file.
|
private java.util.List |
tokens
This ArrayList will keep track of all the tokens in the order that they
are read from the file.
|
private java.util.Set |
uniqueTokens
This HashSet will hold all the unique tokens in the input file.
|
Constructor and Description |
---|
UseBufferedReader() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
The main program for the UseBufferedReader class
|
private void |
printTokenList()
This method prints the tokens
|
private void |
printUniqueTokenList()
This method prints the uniqueTokens
|
private void |
readFileAndLoadCollections()
This method reads a file and loads all of its tokens into 2 collections
|
void |
run()
The intial stating method
|
private java.io.BufferedReader input
private java.util.List tokens
private java.util.Set uniqueTokens
public void run()
private void readFileAndLoadCollections()
private void printTokenList()
private void printUniqueTokenList()
public static void main(java.lang.String[] args) throws java.io.IOException
args
- The command line argumentsjava.io.IOException
- Description of Exception