[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

InsufficientSpaceHandling

Enum Class InsufficientSpaceHandling

java.lang.Object
java.lang.Enum<InsufficientSpaceHandling>
com.grapecity.documents.excel.InsufficientSpaceHandling
All Implemented Interfaces:
Serializable, Comparable<InsufficientSpaceHandling>, Constable

public enum InsufficientSpaceHandling extends Enum<InsufficientSpaceHandling>
指定将数据导入区域时,GcExcel 如何处理目标空间不足的情况。

将此枚举与 DataImportOptions.setInsufficientSpaceHandling(InsufficientSpaceHandling)配合使用,可以控制当目标区域无法容纳完整导入内容时,传入数据是覆盖现有单元格、插入单元格腾出空间,还是被截断。默认行为为 Overwrite。


 worksheet.getRange("A5").setValue("Existing data");
 DataImportOptions options = new DataImportOptions();
 options.setInsufficientSpaceHandling(InsufficientSpaceHandling.InsertCells);
 worksheet.getRange("A1:A4").importData(new double[] {1.0, 2.0, 3.0, 4.0, 5.0}, options);
 
  • Enum Constant Details

  • Method Details

    • values

      public static InsufficientSpaceHandling[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static InsufficientSpaceHandling valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null