Class JChemExcelAPI
java.lang.Object
chemaxon.formats.documents.jchemexcel.JChemExcelAPI
Low-level API to create JChemExcel files
- Since:
- Marvin 5.12
-
Constructor Summary
ConstructorsConstructorDescriptionJChemExcelAPI
(org.apache.poi.ss.usermodel.Workbook wb, OutputStream output) Constructor for adding molecule/structure data one-by-one to store them in a JChemExcel workbook. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, byte[] structureData) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, byte[] structureData, String format) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, byte[] structureData, String id, boolean showId) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, byte[] structureData, String format, String id, boolean showId) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, Molecule molecule, String targetFormat) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, Molecule molecule, String targetFormat, String id, boolean showId) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, String structure) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, String structure, String format) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, String structure, String id, boolean showId) Adds a structure to the cell in the given column/row on the sheet with the given name.org.apache.poi.ss.usermodel.Cell
addStructure
(String worksheetName, int columnIndex, int rowIndex, String structure, String format, String id, boolean showId) Adds a structure to the cell in the given column/row on the sheet with the given name.void
finish()
Writes the workbook to the stream, and closes the stream.org.apache.poi.ss.usermodel.Sheet
getOrCreateWorksheet
(String worksheetName) org.apache.poi.ss.usermodel.Workbook
Returns the Workbook object model instance
-
Constructor Details
-
JChemExcelAPI
public JChemExcelAPI(org.apache.poi.ss.usermodel.Workbook wb, OutputStream output) throws FileNotFoundException, LicenseException Constructor for adding molecule/structure data one-by-one to store them in a JChemExcel workbook. Structures/molecules can be added using addStructure() method overloads.- Parameters:
wb
- the workbook the structures should be added tooutput
- the stream to be written the workbook to- Throws:
FileNotFoundException
LicenseException
-
-
Method Details
-
getWorkbook
public org.apache.poi.ss.usermodel.Workbook getWorkbook()Returns the Workbook object model instance -
getOrCreateWorksheet
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, Molecule molecule, String targetFormat) throws IOException, MolFormatException, ArgumentException Adds a structure to the cell in the given column/row on the sheet with the given name.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tomolecule
- the molecule object of the structuretargetFormat
- the structure format the molecule will be stored on the structure-sheet- Returns:
- the Cell object created
- Throws:
IOException
MolFormatException
ArgumentException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, Molecule molecule, String targetFormat, String id, boolean showId) throws IOException, MolFormatException, ArgumentException Adds a structure to the cell in the given column/row on the sheet with the given name.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tomolecule
- the molecule object of the structuretargetFormat
- the structure format the molecule will be stored on the structure-sheetid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by default- Returns:
- the Cell object created
- Throws:
IOException
MolFormatException
ArgumentException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, String structure) throws MolFormatException, ArgumentException, UnsupportedEncodingException, IOException Adds a structure to the cell in the given column/row on the sheet with the given name. The structure format will be determined automatically, but it causes a substantial overhead compared to when the format also passed as a parameter.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructure
- the structure string- Returns:
- the Cell object created
- Throws:
MolFormatException
ArgumentException
UnsupportedEncodingException
IOException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, String structure, String format) throws UnsupportedEncodingException, MolFormatException, ArgumentException, IOException, UnsupportedOperationException Adds a structure to the cell in the given column/row on the sheet with the given name.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructure
- the structure stringformat
- the structure string format- Returns:
- the Cell object created
- Throws:
UnsupportedEncodingException
MolFormatException
ArgumentException
IOException
UnsupportedOperationException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, String structure, String id, boolean showId) throws MolFormatException, ArgumentException, UnsupportedEncodingException, IOException Adds a structure to the cell in the given column/row on the sheet with the given name. The structure format will be determined automatically, but it causes a substantial overhead compared to when the format also passed as a parameter.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructure
- the structure stringid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))- Returns:
- the Cell object created
- Throws:
MolFormatException
ArgumentException
UnsupportedEncodingException
IOException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, String structure, String format, String id, boolean showId) throws UnsupportedEncodingException, MolFormatException, ArgumentException, IOException, UnsupportedOperationException Adds a structure to the cell in the given column/row on the sheet with the given name.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructure
- the structure stringformat
- the structure string formatid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by default- Returns:
- the Cell object created
- Throws:
UnsupportedEncodingException
MolFormatException
ArgumentException
IOException
UnsupportedOperationException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, byte[] structureData) throws MolFormatException, ArgumentException, IOException, UnsupportedOperationException Adds a structure to the cell in the given column/row on the sheet with the given name. The structure format will be determined automatically, but it causes a substantial overhead compared to when the format also passed as a parameter.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructureData
- the structure data byte-array- Returns:
- the Cell object created
- Throws:
MolFormatException
ArgumentException
IOException
UnsupportedOperationException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, byte[] structureData, String id, boolean showId) throws MolFormatException, ArgumentException, IOException, UnsupportedOperationException Adds a structure to the cell in the given column/row on the sheet with the given name. The structure format will be determined automatically, but it causes a substantial overhead compared to when the format also passed as a parameter.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructureData
- the structure data byte-arrayid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by default- Returns:
- the Cell object created
- Throws:
MolFormatException
ArgumentException
IOException
UnsupportedOperationException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, byte[] structureData, String format) throws UnsupportedOperationException, IOException Adds a structure to the cell in the given column/row on the sheet with the given name.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructureData
- the structure data byte-arrayformat
- the structure data format- Returns:
- the Cell object created
- Throws:
UnsupportedOperationException
IOException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, byte[] structureData, String format, String id, boolean showId) throws UnsupportedOperationException, IOException Adds a structure to the cell in the given column/row on the sheet with the given name.- Parameters:
worksheetName
- sheet name of the structure added tocolumnIndex
- the column-index of the cell the structure added torowIndex
- the row-index of the cell the structure added tostructureData
- the structure data byte-arrayformat
- the structure data formatid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by default- Returns:
- the Cell object created
- Throws:
UnsupportedOperationException
IOException
-
finish
Writes the workbook to the stream, and closes the stream.- Throws:
IOException
-