class Nooz
extends java.lang.Object
Nooz is the driver class for Nooz, a simple newspaper story data system.
Because user interaction with the date is focused on news makers, the primary
data structure used by the driver is a NewsMakerList
, which is
used within main
.
Modifier and Type | Field and Description |
---|---|
private static NewsMakerList |
newsMakers
The list of news makers.
|
Constructor and Description |
---|
Nooz() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
The main method creates the objects necessary to do the work, then lets
them do it.
|
private static NewsMakerList newsMakers
public static void main(java.lang.String[] args) throws java.io.IOException
Reads a data file specified by a program argument passed in by the calling process; this loads in all data used by the program.
Once the data is read in, it enters a user interaction loop, asking for the name of a news maker, then displaying the stories about that news maker or reporting that the news maker is not found in the data, as appropriate. The loop continues until the user enters "Cancel" rather than entering a name.
Note that this program doesn't attempt to deal with I/O errors. This is allowable at this point to keep this project relatively simple and because we haven't covered this topic yet. However, this is something to be refined in the future.
args
- The program arguments passed in by the calling process.java.io.IOException
- If there is an I/O problem reading the data file.