infovis.io
Class AbstractWriter

java.lang.Object
  extended by infovis.io.AbstractWriter
Direct Known Subclasses:
AbstractTreeWriter, AbstractXMLWriter, CSVTableWriter, DOTGraphWriter

public abstract class AbstractWriter
extends Object

Abstract base class for Table writers.

Version:
$Revision: 1.8 $
Author:
Jean-Daniel Fekete

Constructor Summary
AbstractWriter(OutputStream out, String name, Table table)
          Constructor for AbstractWriter
 
Method Summary
 void addAllColumnLabels()
          Adds the name of all the non-internal Columns to the list of written columns.
 void addColumnLabel(String name)
          Adds the name of a Column to write to the list of written column.
 void flush()
           
 String getColumnLabelAt(int col)
          Returns the name of the column to write at a specified index.
 ArrayList getColumnLabels()
          Returns the ArrayList of column names to write.
 String getEncoding()
           
 String getName()
           
 OutputStream getOut()
           
 BufferedWriter getWriter()
           
static String namedType(Column col)
          Returns a type name from a column.
 void setEncoding(String encoding)
           
abstract  boolean write()
          Abstract method that performs the actual writing of data.
 void write(char c)
          Write one character in the output writer.
 void write(String s)
          Write a string in the output writer.
 void writeBuffer()
          Write the StringBuffer in the output writer and clears it.
 void writeln()
          Write a newline in the ouput writer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWriter

public AbstractWriter(OutputStream out,
                      String name,
                      Table table)
Constructor for AbstractWriter

Parameters:
out - the Writer
table - the Table.
Method Detail

getName

public String getName()

namedType

public static String namedType(Column col)
Returns a type name from a column.

Parameters:
col - the column
Returns:
a type name for creating a column of that class.

addColumnLabel

public void addColumnLabel(String name)
Adds the name of a Column to write to the list of written column.

Parameters:
name - the Column name.

addAllColumnLabels

public void addAllColumnLabels()
Adds the name of all the non-internal Columns to the list of written columns.


getColumnLabelAt

public String getColumnLabelAt(int col)
Returns the name of the column to write at a specified index.

Parameters:
col - the index.
Returns:
the name of the column to write at a specified index.

getColumnLabels

public ArrayList getColumnLabels()
Returns the ArrayList of column names to write.

Returns:
the ArrayList of column names to write.

getOut

public OutputStream getOut()

getWriter

public BufferedWriter getWriter()

write

public final void write(char c)
                 throws IOException
Write one character in the output writer.

Parameters:
c - the character.
Throws:
IOException

write

public final void write(String s)
                 throws IOException
Write a string in the output writer.

Parameters:
s - the string.
Throws:
IOException

writeBuffer

public void writeBuffer()
                 throws IOException
Write the StringBuffer in the output writer and clears it.

Throws:
IOException

writeln

public void writeln()
             throws IOException
Write a newline in the ouput writer.

Throws:
IOException

flush

public void flush()
           throws IOException
Throws:
IOException

write

public abstract boolean write()
Abstract method that performs the actual writing of data.


getEncoding

public String getEncoding()

setEncoding

public void setEncoding(String encoding)


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.