Save This Page
Home » jexcelapi_2_6_8 » jxl » [javadoc | source]
jxl
abstract public class: Workbook [javadoc | source]
java.lang.Object
   jxl.Workbook

Direct Known Subclasses:
    WorkbookParser

Represents a Workbook. Contains the various factory methods and provides a variety of accessors which provide access to the work sheets.
Constructor:
 protected Workbook() 
Method from jxl.Workbook Summary:
close,   createWorkbook,   createWorkbook,   createWorkbook,   createWorkbook,   createWorkbook,   createWorkbook,   createWorkbook,   createWorkbook,   findByName,   findCellByName,   getCell,   getNumberOfSheets,   getRangeNames,   getSheet,   getSheet,   getSheetNames,   getSheets,   getVersion,   getWorkbook,   getWorkbook,   getWorkbook,   getWorkbook,   isProtected,   parse
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from jxl.Workbook Detail:
 abstract public  void close()
    Closes this workbook, and frees makes any memory allocated available for garbage collection
 public static WritableWorkbook createWorkbook(File file) throws IOException 
    Creates a writable workbook with the given file name
 public static WritableWorkbook createWorkbook(OutputStream os) throws IOException 
    Creates a writable workbook. When the workbook is closed, it will be streamed directly to the output stream. In this manner, a generated excel spreadsheet can be passed from a servlet to the browser over HTTP
 public static WritableWorkbook createWorkbook(File file,
    WorkbookSettings ws) throws IOException 
    Creates a writable workbook with the given file name
 public static WritableWorkbook createWorkbook(File file,
    Workbook in) throws IOException 
    Creates a writable workbook with the given filename as a copy of the workbook passed in. Once created, the contents of the writable workbook may be modified
 public static WritableWorkbook createWorkbook(OutputStream os,
    Workbook in) throws IOException 
    Creates a writable workbook as a copy of the workbook passed in. Once created, the contents of the writable workbook may be modified
 public static WritableWorkbook createWorkbook(OutputStream os,
    WorkbookSettings ws) throws IOException 
    Creates a writable workbook. When the workbook is closed, it will be streamed directly to the output stream. In this manner, a generated excel spreadsheet can be passed from a servlet to the browser over HTTP
 public static WritableWorkbook createWorkbook(File file,
    Workbook in,
    WorkbookSettings ws) throws IOException 
    Creates a writable workbook with the given filename as a copy of the workbook passed in. Once created, the contents of the writable workbook may be modified
 public static WritableWorkbook createWorkbook(OutputStream os,
    Workbook in,
    WorkbookSettings ws) throws IOException 
    Creates a writable workbook as a copy of the workbook passed in. Once created, the contents of the writable workbook may be modified
 abstract public Range[] findByName(String name)
    Gets the named range from this workbook. The Range object returns contains all the cells from the top left to the bottom right of the range. If the named range comprises an adjacent range, the Range[] will contain one object; for non-adjacent ranges, it is necessary to return an array of length greater than one. If the named range contains a single cell, the top left and bottom right cell will be the same cell
 abstract public Cell findCellByName(String name)
    Gets the named cell from this workbook. If the name refers to a range of cells, then the cell on the top left is returned. If the name cannot be found, null is returned. This is a convenience function to quickly access the contents of a single cell. If you need further information (such as the sheet or adjacent cells in the range) use the functionally richer method, findByName which returns a list of ranges
 abstract public Cell getCell(String loc)
    Returns the cell for the specified location eg. "Sheet1!A4". This is identical to using the CellReferenceHelper with its associated performance overheads, consequently it should be use sparingly
 abstract public int getNumberOfSheets()
    Returns the number of sheets in this workbook
 abstract public String[] getRangeNames()
    Gets the named ranges
 abstract public Sheet getSheet(int index) throws IndexOutOfBoundsException
    Gets the specified sheet within this workbook As described in the accompanying technical notes, each call to getSheet forces a reread of the sheet (for memory reasons). Therefore, do not make unnecessary calls to this method. Furthermore, do not hold unnecessary references to Sheets in client code, as this will prevent the garbage collector from freeing the memory
 abstract public Sheet getSheet(String name)
    Gets the sheet with the specified name from within this workbook. As described in the accompanying technical notes, each call to getSheet forces a reread of the sheet (for memory reasons). Therefore, do not make unnecessary calls to this method. Furthermore, do not hold unnecessary references to Sheets in client code, as this will prevent the garbage collector from freeing the memory
 abstract public String[] getSheetNames()
    Gets the sheet names
 abstract public Sheet[] getSheets()
    Gets the sheets within this workbook. Use of this method for large worksheets can cause performance problems.
 public static String getVersion() 
    Accessor for the software version
 public static Workbook getWorkbook(File file) throws BiffException, IOException 
    A factory method which takes in an excel file and reads in the contents.
 public static Workbook getWorkbook(InputStream is) throws BiffException, IOException 
    A factory method which takes in an excel file and reads in the contents.
 public static Workbook getWorkbook(File file,
    WorkbookSettings ws) throws BiffException, IOException 
    A factory method which takes in an excel file and reads in the contents.
 public static Workbook getWorkbook(InputStream is,
    WorkbookSettings ws) throws BiffException, IOException 
    A factory method which takes in an excel file and reads in the contents.
 abstract public boolean isProtected()
    Determines whether the sheet is protected
 abstract protected  void parse() throws BiffException, PasswordException
    Parses the excel file. If the workbook is password protected a PasswordException is thrown in case consumers of the API wish to handle this in a particular way