org.jstrfile
Class jstrfile

java.lang.Object
  extended byorg.jstrfile.jstrfile

public class jstrfile
extends java.lang.Object

This class creates the .num files which are later read by FileRead to give a random quote no.


Constructor Summary
jstrfile()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main method.
 boolean makeIndex(java.lang.String infile)
          This method makes counts the no. of quotes in the fortune cookie file and creates a .num file with that no.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

jstrfile

public jstrfile()
Method Detail

main

public static void main(java.lang.String[] args)
Main method. This takes in the list of files as arguments and calls makeIndex to make the .num files.

Parameters:
args - An array of strings representing the various files.

makeIndex

public boolean makeIndex(java.lang.String infile)
                  throws java.io.IOException
This method makes counts the no. of quotes in the fortune cookie file and creates a .num file with that no.

Parameters:
infile - path/name of the fortune cookie file.
Returns:
boolean to tell if the file was a fortune cookie file or not.
Throws:
java.io.IOException - for any I/O exceptions.