uk.ac.ebi.adfconverter.common.tools.file.writer
Class PlainTextDataFileWriter

java.lang.Object
  extended byuk.ac.ebi.adfconverter.common.tools.file.writer.ADFConverterFileWriterImpl
      extended byuk.ac.ebi.adfconverter.common.tools.file.writer.PlainTextFileWriter
          extended byuk.ac.ebi.adfconverter.common.tools.file.writer.PlainTextDataFileWriter
All Implemented Interfaces:
ADFConverterFileWriter, DataWriter

public class PlainTextDataFileWriter
extends PlainTextFileWriter
implements DataWriter

Interface for all file format classes used in writing data

Version:
1 ADF MAGE-TOOL - MicroArray Informatics Team / European Bioinformatics Institute (EBI) ArrayExpress License: ============================================================================== Copyright (c) 2002 The European Bioinformatics Institute. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name ArrayExpress must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact arrayexpress@ebi.ac.uk 4. Products derived from this software may not be called "ArrayExpress" nor may "ArrayExpress" appear in their names without prior written permission of the ArrayExpress developers. 5. Redistributions of any form whatsoever must retain the following acknowledgment: "This product includes software developed by ArrayExpress (http://www.ebi.ac.uk/arrayexpress)" THIS SOFTWARE IS PROVIDED BY THE ARRAYEXPRESS GROUP ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARRAYEXPRESS GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The European Bioinformatics Institute may publish revised and/or new versions of this license with new releases of ArrayExpress software. ==============================================================================
Author:
Pierre MARGUERITE
See Also:
DataTable

Constructor Summary
PlainTextDataFileWriter(java.io.File datafile)
          Create an instance of a file writer for a give file
PlainTextDataFileWriter(java.io.File datafile, java.lang.String enc)
          Create an instance of a file writer for a give file with a given Java character encoding
PlainTextDataFileWriter(java.io.File datafile, java.lang.String enc, java.lang.String delimiter, java.lang.String escape)
          Create an instance of a file writer for a give file with a given Java character encoding
 
Method Summary
 void clear()
          Finalization method that closes the file descriptor.
 void closeFile()
          Closes a data text file.
 void openFile()
          Opens a data file for reading or writing
 void setDelimiter(java.lang.String delimiter)
          sets the delimiter character used in the data to delimit data
 void setEscape(java.lang.String escape)
          sets the escape character used in the data to delimit data
 void writeDataLine(DataRow row)
          Write a data row in a file
 void writeHeaderLine(DataTableHeader header)
          Write a table header in a file
 
Methods inherited from class uk.ac.ebi.adfconverter.common.tools.file.writer.PlainTextFileWriter
writeLine
 
Methods inherited from class uk.ac.ebi.adfconverter.common.tools.file.writer.ADFConverterFileWriterImpl
isErasable, setAppend
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.ebi.adfconverter.common.tools.file.writer.DataWriter
isErasable, setAppend
 

Constructor Detail

PlainTextDataFileWriter

public PlainTextDataFileWriter(java.io.File datafile)
Create an instance of a file writer for a give file

Parameters:
datafile - a file to write into

PlainTextDataFileWriter

public PlainTextDataFileWriter(java.io.File datafile,
                               java.lang.String enc)
Create an instance of a file writer for a give file with a given Java character encoding

Parameters:
datafile - a file to write
enc - a specific Java character encoding for writing

PlainTextDataFileWriter

public PlainTextDataFileWriter(java.io.File datafile,
                               java.lang.String enc,
                               java.lang.String delimiter,
                               java.lang.String escape)
Create an instance of a file writer for a give file with a given Java character encoding

Parameters:
datafile - a file to write
enc - a specific Java character encoding for writing
delimiter - the delimiter of data
escape - the escape character
Method Detail

clear

public void clear()
Finalization method that closes the file descriptor. This would work only if JVM is current (1.3 or later?).

Overrides:
clear in class PlainTextFileWriter

closeFile

public void closeFile()
Closes a data text file.

Specified by:
closeFile in interface DataWriter
Overrides:
closeFile in class PlainTextFileWriter

openFile

public void openFile()
              throws java.io.IOException
Opens a data file for reading or writing

Specified by:
openFile in interface DataWriter
Overrides:
openFile in class PlainTextFileWriter
Throws:
java.io.IOException - if an error occurs

setDelimiter

public void setDelimiter(java.lang.String delimiter)
sets the delimiter character used in the data to delimit data

Parameters:
delimiter - the data delimiter string

setEscape

public void setEscape(java.lang.String escape)
sets the escape character used in the data to delimit data

Parameters:
escape - the data escape string

writeDataLine

public void writeDataLine(DataRow row)
                   throws java.io.IOException
Write a data row in a file

Specified by:
writeDataLine in interface DataWriter
Parameters:
row - the data row to write in the file
Throws:
java.io.IOException - if an error occurs during data writing.

writeHeaderLine

public void writeHeaderLine(DataTableHeader header)
                     throws java.io.IOException
Write a table header in a file

Specified by:
writeHeaderLine in interface DataWriter
Parameters:
header - a header to write in the file
Throws:
IOException, - if an error occurs during header (first line) writing
java.io.IOException - if an error occurs during header (first line) writing.


European Bioinformatics InstituteMicroarray Informatics Team