Interface IWorkbookReader


@PublicAPI public interface IWorkbookReader
To instanciate an implementation of the IWorkbookreader interface use the WorkbookHandlerFactory.createWorkbookReader method.
  • Method Details

    • getWorkBook

      Object getWorkBook()
      Get the XSSFWorkBook as object
      Returns:
      XSSFWorkBook
    • getDocumentType

      int getDocumentType()
      Returns the type of the currently read xls document. Available values are: Unknown(0), JChemForXls(2), ChemDraw(4), ISISiSentris(6), AccelrysDraw(8)
      Returns:
      DocumentType
    • getSheetNames

      ArrayList<String> getSheetNames()
      Returns the list of Worksheet names from the Xls Workbook
      Returns:
      List of Sheet Names
    • getStartRowIndex

      Integer getStartRowIndex()
      Get the index of the row from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first row of the document.
      Returns:
      the start row index (indexing start from 0). Default is null.
    • setStartRowIndex

      void setStartRowIndex(Integer index)
      Set the index of the row from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first row of the document.
      Parameters:
      index - : the start row index (indexing start from 0). Default is null.
    • getEndRowIndex

      Integer getEndRowIndex()
      Get the index of the row where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last row of the document.
      Returns:
      the end row index (indexing start from 0). Default is null.
    • setEndRowIndex

      void setEndRowIndex(Integer index)
      Set the index of the row where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last row of the document.
      Parameters:
      index - : the end row index (indexing start from 0). Default is null.
    • getStartColumnIndex

      Integer getStartColumnIndex()
      Get the index of the column from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first column of the document.
      Returns:
      the start column index (indexing start from 0). Default is null.
    • setStartColumnIndex

      void setStartColumnIndex(Integer index)
      Set the index of the column from where the data reading should start. In case of null value, or invalid value (i.e. -1) the reading will start at the first column of the document.
      Parameters:
      index - : the start column index (indexing start from 0). Default is null.
    • getEndColumnIndex

      Integer getEndColumnIndex()
      Get the index of the column where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last column of the document.
      Returns:
      the end column index (indexing start from 0). Default is null.
    • setEndColumnIndex

      void setEndColumnIndex(Integer index)
      Set the index of the column where the data reading should finish. In case of null value, or invalid value (i.e. -1) the reading will end at the last column of the document.
      Parameters:
      index - : the end column index (indexing start from 0). Default is null.
    • getDetectHeader

      boolean getDetectHeader()
      Get if the the header row should be identified automatically. If detectHeader is set to true the headerRow index will be set to null automatically. Default value is false. The automatic detecting means that we find the row above the first structure row and read the column names from this found row. But this found row must be in the given start row - end row range.
      Returns:
      true if the header should be identified automatically, false otherwise. Default is false.
    • setDetectHeader

      void setDetectHeader(boolean detectHeader)
      Set if the the header row should be identified automatically. If detectHeader is set to true the headerRow index will be set to null. The automatic detecting means that we find the row above the first structure row and read the column names from this found row. But this found row must be in the given start row - end row range.
      Parameters:
      detectHeader - : true if the header should be identified automatically, false otherwise. Default is false.
    • getHeaderRowIndex

      Integer getHeaderRowIndex()
      Gets the absolute index of the header row. The index is 0 based. If headerRow is set the detectHeader option will not be used. If the value is null it means the header row is not set.
      Returns:
      0 based index of the header row. Default is null.
    • setHeaderRowIndex

      void setHeaderRowIndex(Integer headerRowIndex)
      Sets the absolute index of the header row. The index is 0 based. If headerRow is set the detectHeader option will not be used. If the value is null it means the header row is not set.
      Parameters:
      headerRowIndex - : 0 based index of the header row. Default is null.
    • getIsReadStructuresOnly

      boolean getIsReadStructuresOnly()
      Defines if only the structures should be read from the workbook or the properties as well.
      Returns:
      true if only the structures should be read from the workbook otherwise false. Default false.
    • setIsReadStructuresOnly

      void setIsReadStructuresOnly(boolean readStructuresOnly)
      Defines if only the structures should be read from the workbook or the properties as well.
      Parameters:
      readStructuresOnly - : true if only the structures should be read from the workbook otherwise false. Default false.
    • readActiveSheet

      Iterable<IMoleculeMap> readActiveSheet() throws Exception
      Gets all the structures from the active sheet based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.
      Returns:
      the list of the structure maps, which contains the location and structure data
      Throws:
      Exception
    • read

      Iterable<IMoleculeMap> read(String sheetName) throws Exception
      Gets all the structures from the given sheet based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.
      Returns:
      the list of the structure maps, which contains the location and structure data
      Throws:
      Exception
    • readAllSheets

      Iterable<IMoleculeMap> readAllSheets() throws Exception
      Gets all the structures from the workbook based on the range given in FirstRowIndex, LastRowIndex, FirstColumnIndex, LastColumnIndex.
      Returns:
      the list of the structure maps, which contains the location and structure data
      Throws:
      Exception
    • isDocumentJCXL

      boolean isDocumentJCXL()
      Determines if the document has ever contained JCXL structures.
      Returns:
      True if the document is JCXL.