org.jfortune
Class FileRead

java.lang.Object
  extended byorg.jfortune.FileRead

public class FileRead
extends java.lang.Object

This class is used to read information from the .num files.


Constructor Summary
FileRead(java.lang.String input)
          Constructor for FileRead.Here i check to see if a a .num file of the parsed file exists or not.If not...i then create it...print out that this is the first time the program was run on this file and exit.A cookie is not actually printed out the first time jfortune will be run on a given file
 
Method Summary
 int getNum()
          This is the method which reads in the no. in the .num of the input file and returns a random integer.The random int is chosen from between 0 and the number of cookies in the file.If the file contains null...i then scold the user saying that he/she was told that the file he/she run jfortune on was not a fortune cookie file and that they should learn to interpret error messages and use google.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRead

public FileRead(java.lang.String input)
         throws java.io.IOException
Constructor for FileRead.Here i check to see if a a .num file of the parsed file exists or not.If not...i then create it...print out that this is the first time the program was run on this file and exit.A cookie is not actually printed out the first time jfortune will be run on a given file

Parameters:
input - A String representing the filename whose .num file needs to be read.
Method Detail

getNum

public int getNum()
This is the method which reads in the no. in the .num of the input file and returns a random integer.The random int is chosen from between 0 and the number of cookies in the file.If the file contains null...i then scold the user saying that he/she was told that the file he/she run jfortune on was not a fortune cookie file and that they should learn to interpret error messages and use google.

Returns:
int An integer containing the no. of the quote we need to display from this file.