Class OutputParser

java.lang.Object
  extended by OutputParser

public class OutputParser
extends java.lang.Object

The OutputParser class is a driver program, that when placed in a directory with TraceSimulator output file(s), will parse that data into a comma- separated-value file - one file a row.


Constructor Summary
OutputParser()
           
 
Method Summary
private static java.lang.String getColumnNames()
          Get a CSV string of the column names for the data being parsed.
private static java.io.File[] getFileList(java.lang.String regexp)
          List all TraceSimulator output files in the current directory.
private static java.lang.String handleSingleInput(java.io.File cur_file)
          Parse a single TraceSimulator output file.
static void main(java.lang.String[] args)
          The main driver method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputParser

public OutputParser()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The main driver method.

Parameters:
args - Two arguments are required, in the following order. First, a regular expression (string) matching the simulator output files which should be processed. Second, the destination of the CSV output.
Throws:
java.lang.Exception

getFileList

private static java.io.File[] getFileList(java.lang.String regexp)
List all TraceSimulator output files in the current directory.

Parameters:
regexp - Regular expression matching output to be processed.
Returns:
An List of type File, containing all such files

getColumnNames

private static java.lang.String getColumnNames()
Get a CSV string of the column names for the data being parsed.

Returns:
Column names for the data being parsed (in CSV form)

handleSingleInput

private static java.lang.String handleSingleInput(java.io.File cur_file)
                                           throws java.lang.Exception
Parse a single TraceSimulator output file.

Parameters:
cur_file - A TraceSimulator output file
Returns:
String containing parsed statistical date (in CSV form)
Throws:
java.lang.Exception