edu.uky.kcr.recordlinkage.datasource
Class CsvFileLinkageDataSource

java.lang.Object
  extended by edu.uky.kcr.recordlinkage.datasource.AbstractLinkageDataSource
      extended by edu.uky.kcr.recordlinkage.datasource.CsvFileLinkageDataSource
All Implemented Interfaces:
LinkageDataSource

public class CsvFileLinkageDataSource
extends AbstractLinkageDataSource

This class encapsulates the parsing of records from a CSV file to use in a linkage operation. The CSV file must include column names as the first line and use a comma as a field separator. Each line in the file is assumed to be a new record.

Author:
ihands

Constructor Summary
CsvFileLinkageDataSource(java.io.File file)
          Constructor that takes only a CSV file, the record key for each record will be assigned internally.
CsvFileLinkageDataSource(java.io.File file, java.lang.String[] recordIdColumnNames)
          Constructor that takes a CSV file and an array of record key column names.
 
Method Summary
 java.io.File getFile()
           
 java.lang.String[] getRecordIdColumns()
           
 void setFile(java.io.File file)
           
 void setRecordIdColumns(java.lang.String[] recordIdColumns)
           
 
Methods inherited from class edu.uky.kcr.recordlinkage.datasource.AbstractLinkageDataSource
allRecords, dispose, getIndex, getPhoneticIndex, getRecordMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvFileLinkageDataSource

public CsvFileLinkageDataSource(java.io.File file)
                         throws java.io.IOException
Constructor that takes only a CSV file, the record key for each record will be assigned internally.

Parameters:
file - CSV file with a comma to separate fields and a new record on each line. The first line should be column names.
Throws:
java.io.IOException

CsvFileLinkageDataSource

public CsvFileLinkageDataSource(java.io.File file,
                                java.lang.String[] recordIdColumnNames)
                         throws java.io.IOException
Constructor that takes a CSV file and an array of record key column names. The record key for each record will be generated from a concatenation of the values of each field in the recordIdColumns array.

Parameters:
file - CSV file with a comma to separate fields and a new record on each line. The first line should be column names.
recordIdColumnNames - Array of column names to use for the record key of each record.
Throws:
java.io.IOException
Method Detail

setRecordIdColumns

public void setRecordIdColumns(java.lang.String[] recordIdColumns)

getRecordIdColumns

public java.lang.String[] getRecordIdColumns()

setFile

public void setFile(java.io.File file)

getFile

public java.io.File getFile()