edu.mssm.crover.imports
Class FortranOutputParser

java.lang.Object
  |
  +--edu.mssm.crover.imports.FortranOutputParser

public class FortranOutputParser
extends java.lang.Object

Parses lines of fortran formated output. Indices of a field in a line start with the value 1.


Constructor Summary
FortranOutputParser()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static int parseInt(java.lang.String line, int first, int last)
          Parse an integer.
static java.lang.String parseString(java.lang.String line, int first, int last)
          Parse a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FortranOutputParser

public FortranOutputParser()
Method Detail

parseInt

public static int parseInt(java.lang.String line,
                           int first,
                           int last)
                    throws InvalidFieldLimits
Parse an integer. Returns the parsed integer.

Parameters:
line - The line of fortran formated text.
first - The index of the first character of this field
last - The index of the last character of this field
Throws:
Thrown - when the limits of the field are not contained in the line, when first is negative or null, when the field could not be interpreted as a text representative of the type the parse method is intended to read.
InvalidFieldLimits

parseString

public static java.lang.String parseString(java.lang.String line,
                                           int first,
                                           int last)
                                    throws InvalidFieldLimits
Parse a String. The only interest of this method, compared to substring, is that is takes care of the indices consistently with the other methods of this class.

Parameters:
line - The line of fortran formated text.
first - The index of the first character of this field
last - The index of the last character of this field
Throws:
Thrown - when the limits of the field are not contained in the line, when first is negative or null, when the field could not be interpreted as a text representative of the type the parse method is intended to read.
InvalidFieldLimits

main

public static void main(java.lang.String[] args)


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.