Spreadsheet Toolkit

corpus.extractor
Class Extractor

java.lang.Object
  |
  +--corpus.extractor.Extractor

public class Extractor
extends java.lang.Object

Extractor is used to call ExcelaccessorRead or JExcelAPI. Once this is done, getWorkBook() can be called to get the WorkBook Object corresponding to the Excel file. A persistent copy will also be stored.


Constructor Summary
Extractor(java.lang.String workbookpath)
          Create a new Extractor for a workbook
 
Method Summary
static void batchExtract(java.lang.String path)
          Given a path, this method will load all the excel spreadsheets in the folder.
 void done()
          This must be called when the Extractor is no longer needed.
protected  void finalize()
          A check to ensure excel is shutdown
static WorkBook forceLoad(Extractor e, java.lang.String path, boolean closeWhenDone, boolean api)
          Reprocess the raw excel file into a workbook regardless of a serialised version on disk.
 WorkBook getWorkBook()
           
static void main(java.lang.String[] args)
          Create an Extractor object and perform some test loads and saves.
static WorkBook read(java.io.File f)
          Given a java.io.File will attempt to read the WorkBook file from disk.
 void switchWorkbook(java.lang.String workbookname)
          Use this if you want to change workbooks and have already used extractor.
static void useJExcelRead()
           
static void useXLAccessor()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extractor

public Extractor(java.lang.String workbookpath)
Create a new Extractor for a workbook

Method Detail

useJExcelRead

public static void useJExcelRead()

useXLAccessor

public static void useXLAccessor()

switchWorkbook

public void switchWorkbook(java.lang.String workbookname)
Use this if you want to change workbooks and have already used extractor.


getWorkBook

public WorkBook getWorkBook()
Returns:
The WorkBook that resulted from processing.

finalize

protected void finalize()
                 throws java.lang.Throwable
A check to ensure excel is shutdown

Overrides:
finalize in class java.lang.Object
java.lang.Throwable

done

public void done()
This must be called when the Extractor is no longer needed. May only be done once per program execution.


batchExtract

public static void batchExtract(java.lang.String path)
Given a path, this method will load all the excel spreadsheets in the folder. For each spreadsheet, it will be processed using Extractor if it hasn't been processed before. If it has been processed before, the file will be loaded straight from the disk into a Workbook. For each Worksheet in each Workbook, processWorksheet will be called on it. %> java corpus.extractor.Extractor -batch


read

public static WorkBook read(java.io.File f)
Given a java.io.File will attempt to read the WorkBook file from disk. If this fails will read from raw file.


forceLoad

public static WorkBook forceLoad(Extractor e,
                                 java.lang.String path,
                                 boolean closeWhenDone,
                                 boolean api)
Reprocess the raw excel file into a workbook regardless of a serialised version on disk. After a successful read, serialise the WorkBook to disk.


main

public static void main(java.lang.String[] args)
Create an Extractor object and perform some test loads and saves.


Spreadsheet Toolkit

Project Home Page