2.17.2: 2011-06-17

net.sf.basedb.util.parser
Class FlatFileParser.Data

java.lang.Object
  extended by net.sf.basedb.util.parser.FlatFileParser.Data
Enclosing class:
FlatFileParser

public static class FlatFileParser.Data
extends Object

This class holds data about a line parsed by the FlatFileParser.hasMoreData() method.

Version:
2.0
Author:
Nicklas
See Also:
FlatFileParser.nextData()

Field Summary
private  int dataLineNo
           
private  boolean emptyIsNull
           
private  String line
           
private  int lineNo
           
private  boolean nullIsNull
           
private  String[] result
           
 
Constructor Summary
private FlatFileParser.Data(int lineNo, int dataLineNo, String line, String[] columns, boolean emptyIsNull, boolean nullIsNull)
          Create a new data object.
 
Method Summary
 int columns()
          The number of columns as determined by the FlatFileParser.setDataSplitterRegexp(Pattern) regular expression.
 String[] data()
          The data line as an array of strings.
 int dataLineNo()
          The line number of the data in the current section.
 String get(int index)
          Get the value in the specified column.
 String line()
          The entire line as it was read from the input stream.
 int lineNo()
          The line number of the data in the input stream.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lineNo

private final int lineNo

dataLineNo

private final int dataLineNo

result

private final String[] result

line

private final String line

emptyIsNull

private final boolean emptyIsNull

nullIsNull

private final boolean nullIsNull
Constructor Detail

FlatFileParser.Data

private FlatFileParser.Data(int lineNo,
                            int dataLineNo,
                            String line,
                            String[] columns,
                            boolean emptyIsNull,
                            boolean nullIsNull)
Create a new data object.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

lineNo

public int lineNo()
The line number of the data in the input stream.

Returns:
The line number

dataLineNo

public int dataLineNo()
The line number of the data in the current section.

Returns:
The line number

line

public String line()
The entire line as it was read from the input stream.

Returns:
A string

columns

public int columns()
The number of columns as determined by the FlatFileParser.setDataSplitterRegexp(Pattern) regular expression.

Returns:
The number of columns in the data line

get

public String get(int index)
Get the value in the specified column.

Parameters:
index - The index for the column, starting at 0
Returns:
The value in the column

data

public String[] data()
The data line as an array of strings.

Since:
2.15

2.17.2: 2011-06-17