Class Fields0

java.lang.Object
   |
   +----Fields0

public class Fields0
extends Object
Demonstrate the ability to scan a file, find a part of the file and extract and store unique fields from the file. Also shows documentation in javadoc form.

Author:
David G. Green

Constructor Index

 o Fields0()

Method Index

 o findField(String)
try to find a field in the list of known fields
 o getLine()
get a line from the input stream
 o main(String[])
main program
 o printFields()
print out the known fields
 o seekStartOfRecord()
seek the start of a record in the input stream
 o updateFields()
read the current record, extract the field, and update the list of known fields

Constructors

 o Fields0
 public Fields0()

Methods

 o main
 public static void main(String args[]) throws IOException
main program

 o seekStartOfRecord
 public static boolean seekStartOfRecord() throws IOException
seek the start of a record in the input stream

Returns:
s whether or not start of record is found
 o getLine
 public static String getLine() throws IOException
get a line from the input stream

 o updateFields
 public static void updateFields() throws IOException
read the current record, extract the field, and update the list of known fields

 o printFields
 public static void printFields()
print out the known fields

 o findField
 public static int findField(String fld)
try to find a field in the list of known fields

Parameters:
fld - - the field to try to find
Returns:
s index into list if found or -1 if not found