apache poi-3.16.jar

  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8.  
  9. http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. ==================================================================== */
  17.  
  18. package org.apache.poi.ss;
  19.  
  20. import org.apache.poi.ss.util.CellReference;
  21.  
  22. /**
  23. * This enum allows spreadsheets from multiple Excel versions to be handled by the common code.
  24. * <p>Properties of this enum correspond to attributes of the <i>spreadsheet</i> that are easily
  25. * discernable to the user. It is not intended to deal with low-level issues like file formats.
  26. */
  27. public enum SpreadsheetVersion {
  28. /**
  29. * Excel97 format aka BIFF8
  30. * <ul>
  31. * <li>The total number of available rows is 64k (2^16)</li>
  32. * <li>The total number of available columns is 256 (2^8)</li>
  33. * <li>The maximum number of arguments to a function is 30</li>
  34. * <li>Number of conditional format conditions on a cell is 3</li>
  35. * <li>Number of cell styles is 4000</li>
  36. * <li>Length of text cell contents is 32767</li>
  37. * </ul>
  38. */
  39. EXCEL97(0x10000, 0x0100, 30, 3, 4000, 32767),
  40.  
  41. /**
  42. * Excel2007
  43. *
  44. * <ul>
  45. * <li>The total number of available rows is 1M (2^20)</li>
  46. * <li>The total number of available columns is 16K (2^14)</li>
  47. * <li>The maximum number of arguments to a function is 255</li>
  48. * <li>Number of conditional format conditions on a cell is unlimited
  49. * (actually limited by available memory in Excel)</li>
  50. * <li>Number of cell styles is 64000</li>
  51. * <li>Length of text cell contents is 32767</li>
  52. * <ul>
  53. */
  54. EXCEL2007(0x100000, 0x4000, 255, Integer.MAX_VALUE, 64000, 32767);
  55.  
  56. private final int _maxRows;
  57. private final int _maxColumns;
  58. private final int _maxFunctionArgs;
  59. private final int _maxCondFormats;
  60. private final int _maxCellStyles;
  61. private final int _maxTextLength;
  62.  
  63. private SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxCellStyles, int maxText) {
  64. _maxRows = maxRows;
  65. _maxColumns = maxColumns;
  66. _maxFunctionArgs = maxFunctionArgs;
  67. _maxCondFormats = maxCondFormats;
  68. _maxCellStyles = maxCellStyles;
  69. _maxTextLength = maxText;
  70. }
  71.  
  72. /**
  73. * @return the maximum number of usable rows in each spreadsheet
  74. */
  75. public int getMaxRows() {
  76. return _maxRows;
  77. }
  78.  
  79. /**
  80. * @return the last (maximum) valid row index, equals to <code> getMaxRows() - 1 </code>
  81. */
  82. public int getLastRowIndex() {
  83. return _maxRows - 1;
  84. }
  85.  
  86. /**
  87. * @return the maximum number of usable columns in each spreadsheet
  88. */
  89. public int getMaxColumns() {
  90. return _maxColumns;
  91. }
  92.  
  93. /**
  94. * @return the last (maximum) valid column index, equals to <code> getMaxColumns() - 1 </code>
  95. */
  96. public int getLastColumnIndex() {
  97. return _maxColumns - 1;
  98. }
  99.  
  100. /**
  101. * @return the maximum number arguments that can be passed to a multi-arg function (e.g. COUNTIF)
  102. */
  103. public int getMaxFunctionArgs() {
  104. return _maxFunctionArgs;
  105. }
  106.  
  107. /**
  108. * @return the maximum number of conditional format conditions on a cell
  109. */
  110. public int getMaxConditionalFormats() {
  111. return _maxCondFormats;
  112. }
  113.  
  114. /**
  115. * @return the maximum number of cell styles per spreadsheet
  116. */
  117. public int getMaxCellStyles() {
  118. return _maxCellStyles;
  119. }
  120.  
  121. /**
  122. *
  123. * @return the last valid column index in a ALPHA-26 representation
  124. * (<code>IV</code> or <code>XFD</code>).
  125. */
  126. public String getLastColumnName() {
  127. return CellReference.convertNumToColString(getLastColumnIndex());
  128. }
  129.  
  130. /**
  131. * @return the maximum length of a text cell
  132. */
  133. public int getMaxTextLength() {
  134. return _maxTextLength;
  135. }
  136. }

Excel不同版本差异性的更多相关文章

  1. poi解析Excel文件版本问题

    poi解析Excel文件时有两种格式: HSSFWorkbook格式用来解析Excel2003(xls)的文件 XSSFWorkbook格式用来解析Excel2007(xlsx)的文件 如果用HSSF ...

  2. Excel的版本

    https://en.wikipedia.org/wiki/Microsoft_Excel 取自维基百科,需要特别注意的是,从v12开始,有很大的改变.后缀名从xls变为xlsx Versions 5 ...

  3. Excel 97-2003版本内部结构与查看方法

    MS-XLS内部结构:BIFF格式 https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/cd03cb5f-ca0 ...

  4. Excel导入数据(97--2003版本)的ExcelHelper

    首先确定excel的版本为97~2003版本 其次创建一个帮助类——ExcelHelper //单个sheet public static DataTable AnalysisExcel(string ...

  5. 判断Excel版本信息

    可以通过获取application对应的Version属性获取当前打开的Excel的版本信息(Application.Version).

  6. java 直接调用micorosoft office (2003-2007和2010版本)中excel中计算函数

    主要是讲述java中poi读取excel,而excel的版本包括:2003-2007和2010两个版本, 即excel的后缀名为:xls和xlsx 读取excel和MySQL相关: java的poi技 ...

  7. 阿里的Easyexcel读取Excel文件(最新版本)

      本篇文章主要介绍一下使用阿里开源的Easyexcel工具处理读取excel文件,因为之前自己想在网上找一下这个简单的立即上手的博客,发现很多文章的教程都针对比较旧的版本的Easyexcel,没有使 ...

  8. NPOI操作EXCEL(二)——大量不同模板时设计方式

    上一篇文章介绍了一些NPOI的基础接口,我们现在就来看看具体怎么用NPOI来解析一个EXCEL. 博主现在有这么一堆excel需要解析数据入库: 当然这只是员工的简要模板,还有很多其他的模板.我们可以 ...

  9. 浅谈Excel开发:十一 针对64位Excel的插件的开发和部署

    自Office 2010版本开始有了32位和64位之分,对Excel来说,32位的Excel和64位的Excel在性能上的主要区别是64位的Excel能够处理2G及2G以上的大数据集. 随着64位操作 ...

随机推荐

  1. Hive(七)Hive参数操作和运行方式

    Hive参数操作和运行方式 1.Hive参数操作 1.hive参数介绍 ​ hive当中的参数.变量都是以命名空间开头的,详情如下表所示: 命名空间 读写权限 含义 hiveconf 可读写 hive ...

  2. 【安徽集训】fiend

    考试的时候只会 \(O(Tn^3)\) 的做法,其它题还都不会,想到一整场就打这么点是人都能写的暴力没啥意思,就懒得写了.. Description 双人博弈.每一轮 A 和 B 同时选择一个 \(1 ...

  3. SQL Server中四类事务并发问题的实例再现(转)

    本篇文章将用实例再现数据库访问中四类并发问题,希望能让初学者能对事务的并行性有进一步的理解. 首先,让我们先来了解一下并行问题以及事务隔离级别这两个概念.在数据库中,假设如果没有锁定且多个用户同时访问 ...

  4. HTML符号代码速查表

    HTML实体符号被用作实现保留字符(reserved characters)或者表达键盘无法输入的一些常用字符.在大多数浏览器中默认的字符集为ISO-8859-1.HTML实体符号使我们在网页设计中经 ...

  5. JS 数组相关的操作函数

    // 1.数组拼接 concat() var a = [1, 2]; var b = [3, 4]; console.log(a.concat(b)); // [1, 2, 3, 4] // 2.数组 ...

  6. servlet 如何处理多请求访问以及线程讲解

    servlet 如何处理多请求访问以及线程讲解 场景:js循环500次请求同一个后台接口,接口内部逻辑:1.查询商品数量,2.扣减商品数量 ,那么该接口是否需要考虑多线程并发安全问题? 分析: 1.先 ...

  7. Task底层实现原理探秘

    .NET 4包含新名称空间System.Threading.Tasks,它 包含的类抽象出了线程功能, 在底层使用ThreadPool. 任务表示应完成的某个单元的工作. 这个单元的工作可以在单独的线 ...

  8. hive日期函数-杂谈(一)

    来到广发返现由于历史遗留问题很多时间格式十分杂乱 我将总结一下时间日期的事情 1.hive原生时间函数的功能 2.一些基本业务时间范围的指标的sql案例 3.自定义udf函数让后来人更方便

  9. Python之exec()/compile()方法使用

    # Python内置函数exec()可以用来执行Python代码 # 或内置函数compile()编译的代码对象 # exec程序中可写入python语法格式的代码,并直接输出. exec('prin ...

  10. BSGS 扩展大步小步法解决离散对数问题 (BZOJ 3239: Discrete Logging// 2480: Spoj3105 Mod)

    我先转为敬? orz% miskcoo 贴板子 BZOJ 3239: Discrete Logging//2480: Spoj3105 Mod(两道题输入不同,我这里只贴了3239的代码) CODE ...