Apache POI jar中的两个'Sheet'类

时间:2021-04-11 19:11:02

Inside the Apache POI jar I see there are two Sheet kind of classes, org.apache.poi.ss.usermodel.Sheet and org.apache.poi.xssf.usermodel.XSSFSheet. What is the difference between them?

在Apache POI jar中,我看到有两种Sheet类,org.apache.poi.ss.usermodel.Sheet和org.apache.poi.xssf.usermodel.XSSFSheet。它们之间有什么区别?

2 个解决方案

#1


2  

High level representation of a SpreadsheetML worksheet. - XSSFSheet . This is to be used when you are dealing with Excel data saved in XML format. Docs are here

SpreadsheetML工作表的高级表示。 - XSSFSheet。当您处理以XML格式保存的Excel数据时,将使用此选项。文件在这里

High level representation of a Excel worksheet.- Sheet . This is the normal excel spreadsheet.

Excel工作表的高级表示.-工作表。这是正常的Excel电子表格。

#2


4  

Actually there are more than two: Sheet is the general interface, and it has several implementations: HSSFSheet (for xls), XSSFSheet (for xlsx), SXSSFSheet (some streaming stuff), etc.

实际上有两个以上:Sheet是通用接口,它有几个实现:HSSFSheet(用于xls),XSSFSheet(用于xlsx),SXSSFSheet(一些流式传输)等。

You should generally use Sheet, which works with any kind of Excel document. Only when you need some special features you should probably look into the implementation classes.

您通常应该使用Sheet,它适用于任何类型的Excel文档。只有当您需要一些特殊功能时,您才应该查看实现类。

#1


2  

High level representation of a SpreadsheetML worksheet. - XSSFSheet . This is to be used when you are dealing with Excel data saved in XML format. Docs are here

SpreadsheetML工作表的高级表示。 - XSSFSheet。当您处理以XML格式保存的Excel数据时,将使用此选项。文件在这里

High level representation of a Excel worksheet.- Sheet . This is the normal excel spreadsheet.

Excel工作表的高级表示.-工作表。这是正常的Excel电子表格。

#2


4  

Actually there are more than two: Sheet is the general interface, and it has several implementations: HSSFSheet (for xls), XSSFSheet (for xlsx), SXSSFSheet (some streaming stuff), etc.

实际上有两个以上:Sheet是通用接口,它有几个实现:HSSFSheet(用于xls),XSSFSheet(用于xlsx),SXSSFSheet(一些流式传输)等。

You should generally use Sheet, which works with any kind of Excel document. Only when you need some special features you should probably look into the implementation classes.

您通常应该使用Sheet,它适用于任何类型的Excel文档。只有当您需要一些特殊功能时,您才应该查看实现类。