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

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

public class WorkBookFileWriterjxl
extends ADFConverterFileWriterImpl
implements DataWriter

Interface for all file format classes used in data writing

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
WorkBookFileWriterjxl(java.io.File datafile)
          WorkBookFileWriterjxl class Constructor.
WorkBookFileWriterjxl(java.io.File datafile, java.lang.String enc)
          WorkBookFileWriterjxl class Constructor.
 
Method Summary
 void closeFile()
          Closes a data workbook file.
 void openFile()
          Opens a data file for writing By default, opens the fisrt sheet of the workbook
 void setSheet(int sheet)
          Sets in which sheet of the wookbook, is supposed to be read
 void setSheet(java.lang.String sheet)
          Sets in which sheet of the wookbook, is supposed to be read
 void setSheet(java.lang.String sheetName, int sheetNumber)
          Sets in which sheet of the wookbook, is supposed to be read
 void writeDataLine(DataRow row)
           Write a data row in a data file
 void writeHeaderLine(DataTableHeader header)
          Write a table header in a file
 void writeLine(DataBuffer line)
           Write a line ina data file Only when termination requirements have been met, the method should return a String object.
 
Methods inherited from class uk.ac.ebi.adfconverter.common.tools.file.writer.ADFConverterFileWriterImpl
clear, 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

WorkBookFileWriterjxl

public WorkBookFileWriterjxl(java.io.File datafile)
WorkBookFileWriterjxl class Constructor. Creates a workbook writer

Parameters:
datafile - the workbook file to write in

WorkBookFileWriterjxl

public WorkBookFileWriterjxl(java.io.File datafile,
                             java.lang.String enc)
WorkBookFileWriterjxl class Constructor. Creates a workbook writer

Parameters:
datafile - the workbook file to write in
enc - a given character encoding
Method Detail

closeFile

public void closeFile()
               throws java.io.IOException
Closes a data workbook file.

Specified by:
closeFile in interface DataWriter
Specified by:
closeFile in class ADFConverterFileWriterImpl
Throws:
java.io.FileNotFoundException, - if file can not be closed
IOException, - if an error occurs during file closing. throws also SecurityException but not handle
java.io.IOException

openFile

public void openFile()
              throws java.io.IOException
Opens a data file for writing By default, opens the fisrt sheet of the workbook

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

setSheet

public void setSheet(int sheet)
              throws java.io.IOException
Sets in which sheet of the wookbook, is supposed to be read

Parameters:
sheet - the number of the wooksheet to write in
Throws:
IOException, - if an error occurs (access problem). (sheet may not exist).
java.io.IOException

setSheet

public void setSheet(java.lang.String sheet)
              throws java.io.IOException
Sets in which sheet of the wookbook, is supposed to be read

Parameters:
sheet - the name of the wooksheet to write in
Throws:
IOException, - if an error occurs (access problem). (sheet may not exist).
java.io.IOException

setSheet

public void setSheet(java.lang.String sheetName,
                     int sheetNumber)
              throws java.io.IOException
Sets in which sheet of the wookbook, is supposed to be read

Parameters:
sheetName - the name of the wooksheet to write in
sheetNumber - the name of the wooksheet to write in
Throws:
IOException, - if an error occurs (access problem). (sheet may not exist)
java.io.IOException

writeDataLine

public void writeDataLine(DataRow row)
                   throws java.io.IOException

Write a data row in a data file

Specified by:
writeDataLine in interface DataWriter
Parameters:
row - containing data items
Throws:
java.io.IOException

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 (usually first line) writing.
java.io.IOException - if an error occurs during header (first line) writing.

writeLine

public void writeLine(DataBuffer line)
               throws java.io.IOException

Write a line ina data file Only when termination requirements have been met, the method should return a String object.

Specified by:
writeLine in interface ADFConverterFileWriter
Specified by:
writeLine in class ADFConverterFileWriterImpl
Parameters:
line - containing data items in one String
Throws:
IOException, - if an error occurs during line writing.
java.io.IOException - if an error occurs during file writing.


European Bioinformatics InstituteMicroarray Informatics Team