Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

CellType.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.ss.usermodel;
  16. import org.apache.poi.ss.formula.FormulaType;
  17. import org.apache.poi.util.Internal;
  18. /**
  19. * @since POI 3.15 beta 3
  20. */
  21. public enum CellType {
  22. /**
  23. * Unknown type, used to represent a state prior to initialization or the
  24. * lack of a concrete type.
  25. * For internal use only.
  26. */
  27. @Internal(since="POI 3.15 beta 3")
  28. _NONE(-1),
  29. /**
  30. * Numeric cell type (whole numbers, fractional numbers, dates)
  31. */
  32. NUMERIC(0),
  33. /** String (text) cell type */
  34. STRING(1),
  35. /**
  36. * Formula cell type
  37. * @see FormulaType
  38. */
  39. FORMULA(2),
  40. /**
  41. * Blank cell type
  42. */
  43. BLANK(3),
  44. /**
  45. * Boolean cell type
  46. */
  47. BOOLEAN(4),
  48. /**
  49. * Error cell type
  50. * @see FormulaError
  51. */
  52. ERROR(5);
  53. /**
  54. * @since POI 3.15 beta 3
  55. * @deprecated POI 3.15 beta 3
  56. */
  57. private final int code;
  58. /**
  59. * @since POI 3.15 beta 3
  60. * @deprecated POI 3.15 beta 3
  61. */
  62. private CellType(int code) {
  63. this.code = code;
  64. }
  65. /**
  66. * @since POI 3.15 beta 3.
  67. * @deprecated POI 3.15 beta 3. Used to transition code from <code>int</code>s to <code>CellType</code>s.
  68. */
  69. public static CellType forInt(int code) {
  70. for (CellType type : values()) {
  71. if (type.code == code) {
  72. return type;
  73. }
  74. }
  75. throw new IllegalArgumentException("Invalid CellType code: " + code);
  76. }
  77. /**
  78. * @since POI 3.15 beta 3
  79. * @deprecated POI 3.15 beta 3
  80. */
  81. public int getCode() {
  82. return code;
  83. }
  84. }