The Meta-Environment API

nl.cwi.sen1.visplugin.csvexport
Class Exporter

java.lang.Object
  extended by nl.cwi.sen1.visplugin.csvexport.Exporter

public class Exporter
extends java.lang.Object

CSV export functionality for RTuples

Author:
Chris Woolderink, Antoine Savelkoul

Nested Class Summary
static class Exporter.ExportSelection
          Enumeration used to indicate which part of a RTuple should be exported to CSV
 
Constructor Summary
Exporter()
           
 
Method Summary
static void export(nl.cwi.sen1.relationstores.types.RTuple rTuple, CsvWriter csvWriter, Exporter.ExportSelection selection)
          Writes the content of a RTupe to a CSV writer
private static void exportColumnTypes(nl.cwi.sen1.relationstores.types.RTypeColumnTypes columnTypes, CsvWriter writer)
          Writes the data types as headers to the CvsWriter
private static void exportData(nl.cwi.sen1.relationstores.types.RTuple rTuple, CsvWriter csvWriter)
          Writes the data of an rTuple to the CvsWriter
static void exportToFile(nl.cwi.sen1.relationstores.types.RTuple rTuple, java.lang.String fileName, Exporter.ExportSelection selection)
          Writes the content of a RTuple to an CSV formatted file
private static java.lang.String RElemToString(nl.cwi.sen1.relationstores.types.RElem elem)
          Converts the value of a simple RElem to a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exporter

public Exporter()
Method Detail

exportToFile

public static void exportToFile(nl.cwi.sen1.relationstores.types.RTuple rTuple,
                                java.lang.String fileName,
                                Exporter.ExportSelection selection)
                         throws java.io.IOException
Writes the content of a RTuple to an CSV formatted file

Parameters:
rTuple - the RTuple to be exported
fileName - the name of the output file
selection - indicates which information has to be exported
Throws:
java.io.IOException

export

public static void export(nl.cwi.sen1.relationstores.types.RTuple rTuple,
                          CsvWriter csvWriter,
                          Exporter.ExportSelection selection)
                   throws java.io.IOException
Writes the content of a RTupe to a CSV writer

Parameters:
rTuple - the RTuple to be exported
csvWriter - the CSV writer to produce the output
selection - indicates which information has to be exported
Throws:
java.io.IOException

exportData

private static void exportData(nl.cwi.sen1.relationstores.types.RTuple rTuple,
                               CsvWriter csvWriter)
                        throws java.io.IOException
Writes the data of an rTuple to the CvsWriter

Parameters:
rTuple - the RTuple to be exported
csvWriter - the CSV writer to produce the output
Throws:
java.io.IOException

exportColumnTypes

private static void exportColumnTypes(nl.cwi.sen1.relationstores.types.RTypeColumnTypes columnTypes,
                                      CsvWriter writer)
                               throws java.io.IOException
Writes the data types as headers to the CvsWriter

Parameters:
columnTypes - column types information that will be used as headers
writer - The CSV writer to produce the output
Throws:
java.io.IOException

RElemToString

private static java.lang.String RElemToString(nl.cwi.sen1.relationstores.types.RElem elem)
Converts the value of a simple RElem to a String

Parameters:
elem - the RElem to be converted
Returns:
the converted RElem

The Meta-Environment API