prefuse.data.io
Class DelimitedTextTableReader

java.lang.Object
  extended by prefuse.data.io.AbstractTableReader
      extended by prefuse.data.io.AbstractTextTableReader
          extended by prefuse.data.io.DelimitedTextTableReader
All Implemented Interfaces:
TableReader

public class DelimitedTextTableReader
extends AbstractTextTableReader

TableReader for delimited text files, such as tab-delimited or pipe-delimited text files. Such files typically list one row of table data per line of the file, using a designated character such as a tab (\t) or pipe (|) to demarcate different data columns. This class allows you to select any regular expression as the column delimiter.

Author:
jeffrey heer

Constructor Summary
DelimitedTextTableReader()
          Create a new DelimitedTextTableReader for reading tab-delimited files using a default parser factory.
DelimitedTextTableReader(ParserFactory parserFactory)
          Create a new DelimitedTextTableReader for reading tab-delimited files.
DelimitedTextTableReader(java.lang.String delimiterRegex)
          Create a new DelimitedTextTableReader using a default parser factory.
DelimitedTextTableReader(java.lang.String delimiterRegex, ParserFactory pf)
          Create a new DelimitedTextTableReader.
 
Method Summary
protected  void read(java.io.InputStream is, TableReadListener trl)
          Scans the input stream, making call backs for each encountered entry on the provided TextReadListener.
 
Methods inherited from class prefuse.data.io.AbstractTextTableReader
getColumnNames, getDefaultHeader, readTable, setHasHeader
 
Methods inherited from class prefuse.data.io.AbstractTableReader
readTable, readTable, readTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimitedTextTableReader

public DelimitedTextTableReader()
Create a new DelimitedTextTableReader for reading tab-delimited files using a default parser factory.


DelimitedTextTableReader

public DelimitedTextTableReader(ParserFactory parserFactory)
Create a new DelimitedTextTableReader for reading tab-delimited files.

Parameters:
parserFactory - the ParserFactory to use for parsing text strings into table values.

DelimitedTextTableReader

public DelimitedTextTableReader(java.lang.String delimiterRegex)
Create a new DelimitedTextTableReader using a default parser factory.

Parameters:
delimiterRegex - a regular expression string indicating the delimiter to use to separate column values

DelimitedTextTableReader

public DelimitedTextTableReader(java.lang.String delimiterRegex,
                                ParserFactory pf)
Create a new DelimitedTextTableReader.

Parameters:
delimiterRegex - a regular expression string indicating the delimiter to use to separate column values
pf - the ParserFactory to use for parsing text strings into table values.
Method Detail

read

protected void read(java.io.InputStream is,
                    TableReadListener trl)
             throws java.io.IOException,
                    DataParseException
Description copied from class: AbstractTextTableReader
Scans the input stream, making call backs for each encountered entry on the provided TextReadListener.

Specified by:
read in class AbstractTextTableReader
Parameters:
is - the InputStream to read
trl - the TextReadListener that will receive callbacks
Throws:
java.io.IOException
DataParseException
See Also:
AbstractTextTableReader.read(java.io.InputStream, prefuse.data.io.TableReadListener)


Copyright © 2007 Regents of the University of California