prefuse.data.io
Class FixedWidthTextTableWriter

java.lang.Object
  extended by prefuse.data.io.AbstractTableWriter
      extended by prefuse.data.io.FixedWidthTextTableWriter
All Implemented Interfaces:
TableWriter

public class FixedWidthTextTableWriter
extends AbstractTableWriter

TableWriter for fixed-width text files, that encode one row of table data per line use a fixed number of characters for each data column. Writing such tables requires use of a schema description that describes the fixed-widths for each individual column. The FixedWidthTextTableSchema class provides this functionality. A schema description must be written separately into a different file.

Author:
jeffrey heer

Constructor Summary
FixedWidthTextTableWriter(FixedWidthTextTableSchema schema)
          Creates a new FixedWidthTextTableWriter using the given schema.
FixedWidthTextTableWriter(java.lang.String location)
          Creates a new FixedWidthTextTableWriter using the schema at the given location.
 
Method Summary
 FixedWidthTextTableSchema getFixedWidthSchema()
          Get the schema description describing the data columns' fixed widths
 void setFixedWidthSchema(FixedWidthTextTableSchema schema)
          Set the schema description describing the data columns' fixed widths
 void writeTable(Table table, java.io.OutputStream os)
          Write a table from the given OutputStream.
 
Methods inherited from class prefuse.data.io.AbstractTableWriter
writeTable, writeTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedWidthTextTableWriter

public FixedWidthTextTableWriter(FixedWidthTextTableSchema schema)
Creates a new FixedWidthTextTableWriter using the given schema.

Parameters:
schema - the schema description of the fixed-width text column lengths

FixedWidthTextTableWriter

public FixedWidthTextTableWriter(java.lang.String location)
                          throws DataIOException
Creates a new FixedWidthTextTableWriter using the schema at the given location.

Parameters:
location - a location string (filename, URL, or resource locator) for the schema description of the fixed-width text column lengths
Throws:
DataIOException - if an IO exception occurs while loading the schema
Method Detail

getFixedWidthSchema

public FixedWidthTextTableSchema getFixedWidthSchema()
Get the schema description describing the data columns' fixed widths

Returns:
the fixed-width table schema description

setFixedWidthSchema

public void setFixedWidthSchema(FixedWidthTextTableSchema schema)
Set the schema description describing the data columns' fixed widths

Parameters:
schema - the fixed-width table schema description

writeTable

public void writeTable(Table table,
                       java.io.OutputStream os)
                throws DataIOException
Description copied from interface: TableWriter
Write a table from the given OutputStream.

Parameters:
table - the Table to write
os - the OutputStream to write the table to
Throws:
DataIOException
See Also:
TableWriter.writeTable(prefuse.data.Table, java.io.OutputStream)


Copyright © 2007 Regents of the University of California