util
Class LineExtract

java.lang.Object
  extended by util.LineExtract

public class LineExtract
extends Object

Purpose of this class is to provide means to read an ascii-column file. It takes a line of doubles, separated with withespaces as an input together with an integer array containing columns# of values. Column numbering starts with 1!


Constructor Summary
LineExtract()
           
 
Method Summary
static double get(String line, int nr)
          Wrapper for one element reads.
static double[] get(String line, int[] nr)
          Multicolumn extract of doubles from line line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineExtract

public LineExtract()
Method Detail

get

public static double get(String line,
                         int nr)
Wrapper for one element reads. The element with the specified index number is returned

Parameters:
line - The ascii-line consisting of white-space separated doubles.
nr - The column number to extract, 1=first element
Returns:
The value of the specified double

get

public static double[] get(String line,
                           int[] nr)
Multicolumn extract of doubles from line line. The column numbers of the doubles to be extracted are stored in the index array. If parsing the column fails, zero is inserted.

Parameters:
line - The ascii-line consisting of white-space separated doubles.
nr - The column numbers to extract, 1=first element.
Returns:
An array of doubles indexed equivalently to the column number array.