DataFile 1.4

com.infomata.data
Interface DataFormat

All Known Implementing Classes:
CSVFormat, FixedWidthFormat, ItemPerLineFormat, SimpleDelimiterFormat, TabFormat

public interface DataFormat

Interface for all data format classes used in reading and writing a data file.

Version:
$Revision: 1.1 $
Author:
Sam Kim
See Also:
DataFile

Method Summary
 java.lang.String format(DataRow row)
          Converts the data contained in the DataRow object into a line of data.
 DataRow parseLine(java.lang.String line)
           Parses a line of data into a DataRow object which contains each data item in individual cells.
 

Method Detail

parseLine

public DataRow parseLine(java.lang.String line)

Parses a line of data into a DataRow object which contains each data item in individual cells. If the line of data does not terminate properly, the method must return null and keep the currently parsed row in memory for further processing. Only when termination requirements have been met, the method should return a DataRow object.

For example, a CSV formated cell may contain a new line character. Since the each line is delimited using new line character, the line may contain only a part of the CSV data cell content. The CSVFormat implementation does not return a non-null reference to the DataRow object until that cell has been terminated properly.

Parameters:
line - line containing data items.
Returns:
a DataRow object containing data items in individual cells.

format

public java.lang.String format(DataRow row)
Converts the data contained in the DataRow object into a line of data.

Parameters:
row - a DataRow object containing data
Returns:
String representing data items contained in DataRow object.

DataFile 1.4

Copyright © 2004 Infomata. All Rights Reserved.