2020-01-20 关于Arrays.copyOf(original, newLength);关于CellCopyPolicy

一.java.util.Arrays.copyOf(original, newLength);

original :一个用于被复制数组;
newLength:指定复制的范围[0,newLength);
超出original.length的部分为null.
示例:

String [] original = new String [] { "X","M","K","D" };
Arrays.copyOf(original, original.length+3);
System.out.println( Arrays.toString( Arrays.copyOf(original, original.length) ) );
System.out.println( Arrays.toString( Arrays.copyOf(original, original.length+3) ) );
System.out.println( Arrays.toString( Arrays.copyOf(original, original.length-1) ) );

运行结果:
[X, M, K, D]
[X, M, K, D, null, null, null]
[X, M, K]

二.org.apache.poi.ss.usermodel.CellCopyPolicy

CellCopyPolicy是POI包中用于设置复制单元格的信息的策略。
主要有8个属性,其内容及默认值如下所示:

 	// cell-level policies	单元格级别策略
 	//是否复制单元格的值
    public static final boolean DEFAULT_COPY_CELL_VALUE_POLICY = true;
  	//是否复制单元格的格式
    public static final boolean DEFAULT_COPY_CELL_STYLE_POLICY = true;
    //是否复制单元格的公式
    public static final boolean DEFAULT_COPY_CELL_FORMULA_POLICY = true;
     //是否复制单元格的超链接
    public static final boolean DEFAULT_COPY_HYPERLINK_POLICY = true;
     //是否合并单元格的超链接
    public static final boolean DEFAULT_MERGE_HYPERLINK_POLICY = false;
 	
    // row-level policies	行级别策略
     //是否复制此行的高度
    public static final boolean DEFAULT_COPY_ROW_HEIGHT_POLICY = true;
     //这个见下文
    public static final boolean DEFAULT_CONDENSE_ROWS_POLICY = false;
    
    // sheet-level policies	工作页级别策略
     //是否复制工作页的合并区域
    public static final boolean DEFAULT_COPY_MERGED_REGIONS_POLICY = true;

你可能感兴趣的:(java,poi)