Spreadsheet Toolkit

corpus.extractor
Class ExcelaccessorRead

java.lang.Object
  |
  +--corpus.extractor.ExcelaccessorRead
All Implemented Interfaces:
java.util.EventListener, com.ibm.excelaccessor.event.ExcelRangeListener, com.ibm.excelaccessor.event.ExcelWorkbookListener, com.ibm.excelaccessor.event.FetchArgumentsListener

public class ExcelaccessorRead
extends java.lang.Object
implements com.ibm.excelaccessor.event.ExcelRangeListener, com.ibm.excelaccessor.event.ExcelWorkbookListener, com.ibm.excelaccessor.event.FetchArgumentsListener


Constructor Summary
ExcelaccessorRead(java.lang.String workbookname)
          Create a new ExcelaccessorRead using the default workbookname.
 
Method Summary
 void closeDownExcel()
          Shutsdown excel, currently further attempts to use extractor will fail.
 void fetchArgumentsCalled(com.ibm.excelaccessor.event.FetchArgumentsEvent arg1)
          This code fills in the worksheets array from the workbook.
 WorkBook getWorkBook()
           
static void main(java.lang.String[] args)
          The main method of the ExcelaccessorRead class creates a new ExcelaccessorRead object.
 void rangeInitialized(com.ibm.excelaccessor.event.ExcelRangeEvent arg1)
          Setting the autoGetUsedRange flag to "true" we force the ExcelRange1 object to determine the used range of the workbook.
 void rangeUninitialized(com.ibm.excelaccessor.event.ExcelRangeEvent arg1)
           
 void startApp()
          Called after switchWorkbook();.
 void switchWorkbook(java.lang.String workbookname)
           
 void workbookClosed(com.ibm.excelaccessor.event.ExcelWorkbookEvent arg1)
           
 void workbookOpened(com.ibm.excelaccessor.event.ExcelWorkbookEvent arg1)
          The startApp() method calls the openWorkbook() method of the ExcelWorkbook1 object.
 void workbookStructureUnprotected(com.ibm.excelaccessor.event.ExcelWorkbookEvent arg1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelaccessorRead

public ExcelaccessorRead(java.lang.String workbookname)
Create a new ExcelaccessorRead using the default workbookname.

Method Detail

main

public static void main(java.lang.String[] args)
The main method of the ExcelaccessorRead class creates a new ExcelaccessorRead object. The constructor instantiates the ExcelRange1 and the ExcelWorkbook1 attributes, and sets the listener classes, then calls the startApp() method.


switchWorkbook

public void switchWorkbook(java.lang.String workbookname)

startApp

public void startApp()
Called after switchWorkbook();. Opens the workbook, processes contents then closes workbook.


closeDownExcel

public void closeDownExcel()
Shutsdown excel, currently further attempts to use extractor will fail.


getWorkBook

public WorkBook getWorkBook()
Returns:
the WorkBook that represents the Excel file

fetchArgumentsCalled

public void fetchArgumentsCalled(com.ibm.excelaccessor.event.FetchArgumentsEvent arg1)
This code fills in the worksheets array from the workbook. As the workbook is successfully opened, you can call the initRange() method. The initRange() method fires the FetchArgumentsCalled event, hence the fetchArgumentsCalled() method will be called.

Specified by:
fetchArgumentsCalled in interface com.ibm.excelaccessor.event.FetchArgumentsListener

rangeInitialized

public void rangeInitialized(com.ibm.excelaccessor.event.ExcelRangeEvent arg1)
Setting the autoGetUsedRange flag to "true" we force the ExcelRange1 object to determine the used range of the workbook. After the range is successfully initialized, the rangeInitialized ExcelRangeEvent event will be fired.

Specified by:
rangeInitialized in interface com.ibm.excelaccessor.event.ExcelRangeListener

rangeUninitialized

public void rangeUninitialized(com.ibm.excelaccessor.event.ExcelRangeEvent arg1)
Specified by:
rangeUninitialized in interface com.ibm.excelaccessor.event.ExcelRangeListener

workbookClosed

public void workbookClosed(com.ibm.excelaccessor.event.ExcelWorkbookEvent arg1)
Specified by:
workbookClosed in interface com.ibm.excelaccessor.event.ExcelWorkbookListener

workbookOpened

public void workbookOpened(com.ibm.excelaccessor.event.ExcelWorkbookEvent arg1)
The startApp() method calls the openWorkbook() method of the ExcelWorkbook1 object. When the workbook is successfully opened the workbookOpened ExcelWorkbookEvent event is fired. As the ExcelaccessorRead class listens to this event, the workbookOpened() method will be called.

Specified by:
workbookOpened in interface com.ibm.excelaccessor.event.ExcelWorkbookListener

workbookStructureUnprotected

public void workbookStructureUnprotected(com.ibm.excelaccessor.event.ExcelWorkbookEvent arg1)
Specified by:
workbookStructureUnprotected in interface com.ibm.excelaccessor.event.ExcelWorkbookListener

Spreadsheet Toolkit

Project Home Page