org.pz.platypus
Class Infile

java.lang.Object
  extended by org.pz.platypus.Infile

public class Infile
extends java.lang.Object

Handles input file I/O functions.

Author:
alb

Field Summary
private  int currFileNumber
          the current line number and filenumber
private  int currLineNumber
           
private  java.lang.String filename
          the name of the input file
private  GDD gdd
          the GDD
private  java.io.BufferedReader inReader
          input reader for file
private  boolean isOpen
          file open status
 
Constructor Summary
Infile(java.lang.String name, GDD Gdd)
           
 
Method Summary
 java.lang.String getFilename()
           
 int getLineNumber()
           
 int open()
          open the file
 int readFileIntoInputLines(LineList textLines)
          Reads the input file on a line basis, adding each line to an ArrayList for later processing.
private  int readNext1LineIntoInputLine(InputLine inputLine)
          Reads a single line from the input file and converts into an InputLine data structure, which contains, the file number of the input file, the line number of the line, plus the content of the line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

private final java.lang.String filename
the name of the input file


isOpen

private boolean isOpen
file open status


inReader

private java.io.BufferedReader inReader
input reader for file


currFileNumber

private int currFileNumber
the current line number and filenumber


currLineNumber

private int currLineNumber

gdd

private GDD gdd
the GDD

Constructor Detail

Infile

public Infile(java.lang.String name,
              GDD Gdd)
Method Detail

readFileIntoInputLines

public int readFileIntoInputLines(LineList textLines)
Reads the input file on a line basis, adding each line to an ArrayList for later processing. Lines where the first character is a comment are skipped (that is, not saved) in this process.

Parameters:
textLines - array of InputLine's into which the file will be read.
Returns:
the number the total number of lines read or an error code on exception

readNext1LineIntoInputLine

private int readNext1LineIntoInputLine(InputLine inputLine)
Reads a single line from the input file and converts into an InputLine data structure, which contains, the file number of the input file, the line number of the line, plus the content of the line

Parameters:
inputLine - the InputLine into which the line of content is placed
Returns:
Status.OK; Status.EOF at EOF; Status.IO_ERR if something goes wrong.

open

public int open()
open the file

Returns:
Status.OK, if all went well; Status.FILE_NOT_FOUND_ERR, which should not occur.

getFilename

public java.lang.String getFilename()

getLineNumber

public int getLineNumber()


Copyright © 2008-10 Pacific Data Works LLC