Class JChemExcelAPI
- java.lang.Object
-
- chemaxon.formats.documents.jchemexcel.JChemExcelAPI
-
@PublicAPI public class JChemExcelAPI extends Object
Low-level API to create JChemExcel files- Since:
- Marvin 5.12
-
-
Constructor Summary
Constructors Constructor Description JChemExcelAPI(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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
finalize()
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
getWorkbook()
Returns the Workbook object model instance
-
-
-
Constructor Detail
-
JChemExcelAPI
public JChemExcelAPI(org.apache.poi.ss.usermodel.Workbook wb, OutputStream output) throws FileNotFoundException, chemaxon.license.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
chemaxon.license.LicenseException
-
-
Method Detail
-
getWorkbook
public org.apache.poi.ss.usermodel.Workbook getWorkbook()
Returns the Workbook object model instance
-
getOrCreateWorksheet
public org.apache.poi.ss.usermodel.Sheet getOrCreateWorksheet(String worksheetName)
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, Molecule molecule, String targetFormat) throws IOException, MolFormatException, chemaxon.util.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
chemaxon.util.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, chemaxon.util.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
chemaxon.util.ArgumentException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, String structure) throws MolFormatException, chemaxon.util.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
chemaxon.util.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, chemaxon.util.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
chemaxon.util.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, chemaxon.util.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
chemaxon.util.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, chemaxon.util.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
chemaxon.util.ArgumentException
IOException
UnsupportedOperationException
-
addStructure
public org.apache.poi.ss.usermodel.Cell addStructure(String worksheetName, int columnIndex, int rowIndex, byte[] structureData) throws MolFormatException, chemaxon.util.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
chemaxon.util.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, chemaxon.util.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
chemaxon.util.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
public void finish() throws IOException
Writes the workbook to the stream, and closes the stream.- Throws:
IOException
-
-