org.virbo.dsutil
Class AsciiParser.FixedColumnsParser

java.lang.Object
  extended by org.virbo.dsutil.AsciiParser.FixedColumnsParser
All Implemented Interfaces:
AsciiParser.RecordParser
Enclosing class:
AsciiParser

public final class AsciiParser.FixedColumnsParser
extends java.lang.Object
implements AsciiParser.RecordParser


Constructor Summary
AsciiParser.FixedColumnsParser(int[] columnOffsets, int[] columnWidths)
           
 
Method Summary
 int fieldCount()
          indicate the number of fields this RecordParser is expecting on each line.
 int fieldCount(java.lang.String line)
          return the number of fields in this line.
 java.lang.String[] fields(java.lang.String line)
          return the string for each field.
 boolean tryParseRecord(java.lang.String line, int irec, DataSetBuilder builder)
          returns true if the line appears to be a record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiParser.FixedColumnsParser

public AsciiParser.FixedColumnsParser(int[] columnOffsets,
                                      int[] columnWidths)
Method Detail

fieldCount

public int fieldCount()
Description copied from interface: AsciiParser.RecordParser
indicate the number of fields this RecordParser is expecting on each line.

Specified by:
fieldCount in interface AsciiParser.RecordParser

tryParseRecord

public final boolean tryParseRecord(java.lang.String line,
                                    int irec,
                                    DataSetBuilder builder)
Description copied from interface: AsciiParser.RecordParser
returns true if the line appears to be a record. If it is a record, then the record is inserted into the builder.

Specified by:
tryParseRecord in interface AsciiParser.RecordParser

fieldCount

public int fieldCount(java.lang.String line)
Description copied from interface: AsciiParser.RecordParser
return the number of fields in this line. All records will have this number of fields. This is used for discovery and to configure the parser.

Specified by:
fieldCount in interface AsciiParser.RecordParser

fields

public java.lang.String[] fields(java.lang.String line)
Description copied from interface: AsciiParser.RecordParser
return the string for each field. This is useful for discovery, and is not used in the bulk parsing.

Specified by:
fields in interface AsciiParser.RecordParser
Returns: