edu.ksu.cis.kdd.data.converter.excel
Class ExcelConverter

java.lang.Object
  extended byedu.ksu.cis.kdd.data.converter.excel.ExcelConverter
All Implemented Interfaces:
Converter

public class ExcelConverter
extends java.lang.Object
implements Converter

Microsoft(R) Excel(TM) format.

User has the option of including the range of cells that contains the actual data. If the ranges are not specified, then the data is assumed to begin at cell A1 and ends at the row/column size returned by the API.

The actual data must include the title row as the first row AND assuming that between the title row and the actual data there are no blank rows. Also, it is not allowed to have a merged columns at any time. Otherwise the program will throw errors silently.

If we have PRM (or multiple tables), each table must be written in separate sheet. Also, please delete any superfluous / empty sheet so that the "autodetection" can work.

Currently, no charts or pictures are allowed. And there is no way to recover primary / reference key in here (except if we somehow "cheat" later, but definitely not now).

NOTE: Everything is imported as string for now!!!

Author:
Roby Joehanes

Field Summary
protected  ExcelSheetRange[] ranges
          Range of cells (in each sheet) that contains the actual data.
 
Constructor Summary
ExcelConverter()
           
 
Method Summary
 void initialize()
           
 Database load(java.io.InputStream stream)
           
 void save(java.io.OutputStream stream, Database db)
           
 void setRanges(ExcelSheetRange[] ranges)
           
 void setRanges(java.lang.String str)
          Specify the ranges of cells in each sheet, if it doesn't start at A1 as requested (see header).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ranges

protected ExcelSheetRange[] ranges
Range of cells (in each sheet) that contains the actual data. See the assumption above!

Constructor Detail

ExcelConverter

public ExcelConverter()
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface Converter
See Also:
Converter.initialize()

setRanges

public void setRanges(ExcelSheetRange[] ranges)

setRanges

public void setRanges(java.lang.String str)

Specify the ranges of cells in each sheet, if it doesn't start at A1 as requested (see header). E.g.:
B5:G10,A2:H8,B4:J15

That means that the first sheet's data is at B5:G10 cells, second sheet data is at A2:H8, third sheet is at B4:J15 (just like Excel).

Note: If you specify this from the command line, you cannot insert spaces between the commas.

Parameters:
str -

load

public Database load(java.io.InputStream stream)
Specified by:
load in interface Converter
See Also:
Converter.load(java.io.InputStream)

save

public void save(java.io.OutputStream stream,
                 Database db)
Specified by:
save in interface Converter
See Also:
edu.ksu.cis.kdd.data.converter.Converter#save(java.io.OutputStream, edu.ksu.cis.kdd.data.datastructure.Table)