SORTIE Java Interface  1
Static Public Member Functions | List of all members
sortie.fileops.ModelFileFunctions Class Reference

This provides common file-reading functions for reading tab-delimited files. More...

Static Public Member Functions

static void skipLine (FileReader in) throws ModelException
 Advances a file stream to the beginning of the next line. More...
 
static ArrayList< String > readLine (FileReader in) throws IOException
 Reads a line from a tab-delimited text file. More...
 
static int countLines (String filename) throws ModelException
 Counts the number of text lines in a file. More...
 

Detailed Description

This provides common file-reading functions for reading tab-delimited files.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Member Function Documentation

◆ countLines()

static int sortie.fileops.ModelFileFunctions.countLines ( String  filename) throws ModelException
static

Counts the number of text lines in a file.

Parameters
filenameFile to count.
Returns
Number of lines in the file.

◆ readLine()

static ArrayList<String> sortie.fileops.ModelFileFunctions.readLine ( FileReader  in) throws IOException
static

Reads a line from a tab-delimited text file.

Each cell in the line is placed in a separate bucket of a Vector. The file stream is then advanced to the beginning of the next line.

Parameters
inThe file stream to read from.
Returns
The vector representing the file line.
Exceptions
java.io.IOException- passthru from FileReader

◆ skipLine()

static void sortie.fileops.ModelFileFunctions.skipLine ( FileReader  in) throws ModelException
static

Advances a file stream to the beginning of the next line.

Parameters
inThe file stream to advance.
Exceptions
ModelExceptionwith error code TAB_PAR_FILE_PREMATURE_END if the input stream is currently at end of file. Reaching the end of file after that point will not cause this exception to be thrown.

The documentation for this class was generated from the following file: