org.ttzero.excel.entity.e3.MulRKParser Maven / Gradle / Ivy
/*
* Copyright (c) 2019-2020, [email protected] All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ttzero.excel.entity.e3;
/**
* 5.69 MULRK – Multiple RK
*
* This record represents a cell range containing RK value cells.
* All cells are located in the same row.
*
* @author guanquan.wang at 2019-04-18 22:44
*/
public class MulRKParser {
public static void get(Block block, MulRK mulRK) {
short size = block.nextShort();
// Index to row
mulRK.row = block.nextUnsignedShort();
// Index to first column (fc)
mulRK.fc = block.nextShort();
// List of nc=lc-fc+1 16-bit indexes to XF records (➜5.115)
int nc = size / 6 - 1;
MulRK.XFRK[] xfrks = new MulRK.XFRK[nc];
for (int i = 0; i < nc; i++) {
xfrks[i] = new MulRK.XFRK();
xfrks[i].xf = block.nextShort();
xfrks[i].rkValue = new RKValue(block.nextInt());
}
mulRK.xfrks = xfrks;
// Index to last column (lc)
mulRK.lc = block.nextShort();
}
public static short getId() {
return ParserIdentifier.MULRK;
}
}