org.virbo.dsutil
Class AsciiParser.RegexParser

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

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


Constructor Summary
AsciiParser.RegexParser(java.lang.String regex)
           
 
Method Summary
 int fieldCount()
          indicate the number of fields this RecordParser is expecting on each line.
 int fieldCount(java.lang.String line)
          return what this would be if spitting by whitespace.
 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.RegexParser

public AsciiParser.RegexParser(java.lang.String regex)
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)
return what this would be if spitting by whitespace.

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: