edu.iastate.metnet.birdseyeview
Class Loader

java.lang.Object
  extended by edu.iastate.metnet.birdseyeview.Loader

public class Loader
extends java.lang.Object

The Loader Class reads in a file and returns an array of elements of interest.

Author:
Matt Studham Created Mar 18, 2005

Constructor Summary
Loader()
           
 
Method Summary
static void main(java.lang.String[] args)
          This method tests the Loader class.
static java.util.ArrayList run(java.lang.String filePath, int fieldIndex)
          This method reads the given file and returns a list of the fields with the given index.
static java.util.ArrayList runIntegration(java.lang.String filePath)
          This method reads the integrated file and outputs the experiments and probes list
static java.util.ArrayList runIntegVar(java.lang.String filePath, int fieldIndex)
          This method reads the integrated file and outputs the variances list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Loader

public Loader()
Method Detail

run

public static java.util.ArrayList run(java.lang.String filePath,
                                      int fieldIndex)
                               throws java.lang.Exception,
                                      FieldNotFoundException
This method reads the given file and returns a list of the fields with the given index. It is assumed that files contain rows of records (one on each line) and that each field in a record is separated by whitespace. The field indices start with 0. If there are consecutive delimiters, it's assumed that there is a null field, so the resulting list may contain nulls. If there is any problem with any line an exception will be returned.

Parameters:
filePath - Fully qualified file path
fieldIndex - Index (column) of the desired field in the rows of records
Returns:
ArrayList List of String objects of desired field values in order by row; may contain null elements
Throws:
java.lang.Exception - Problem reading the file
FieldNotFoundException - Field index refers to a non-existent field

runIntegration

public static java.util.ArrayList runIntegration(java.lang.String filePath)
                                          throws java.lang.Exception,
                                                 FieldNotFoundException
This method reads the integrated file and outputs the experiments and probes list

Parameters:
filePath - Fully qualified file path
Returns:
ArrayList List of List of expements and Probes
Throws:
java.lang.Exception - Problem reading the file
FieldNotFoundException - Field index refers to a non-existent field

runIntegVar

public static java.util.ArrayList runIntegVar(java.lang.String filePath,
                                              int fieldIndex)
                                       throws java.lang.Exception,
                                              FieldNotFoundException
This method reads the integrated file and outputs the variances list

Parameters:
filePath - Fully qualified file path
Returns:
ArrayList List of Variances
Throws:
java.lang.Exception - Problem reading the file
FieldNotFoundException - Field index refers to a non-existent field

main

public static void main(java.lang.String[] args)
This method tests the Loader class.

Parameters:
args -