org.ttzero.excel.entity.e3.LabelSSTParser 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;
import org.ttzero.excel.reader.AllInOneCell;
/**
* 5.65 LABELSST
*
* This record represents a cell that contains a string.
* It replaces the LABEL record (➜5.63)
* and RSTRING record (➜5.89)
* used in BIFF2-BIFF5. See ➜4.11 for more information
* about shared string tables
*
* @author guanquan.wang at 2019-04-18 19:28
*/
public class LabelSSTParser {
public static LabelSST get(Block block) {
block.nextShort();
LabelSST sst = new LabelSST();
// Index to row
sst.row = block.nextUnsignedShort();
// Index to column
sst.column = block.nextShort();
// Index to XF record (➜5.115)
sst.xf = block.nextShort();
// Index into SST record (➜5.100)
sst.sst = block.nextInt();
return sst;
}
public static void get(Block block, AllInOneCell cell) {
block.skip(2);
// Index to row
cell.row = block.nextUnsignedShort();
// Index to column
cell.column = block.nextShort();
// Index to XF record (➜5.115)
cell.xf = block.nextShort();
// Index into SST record (➜5.100)
cell.sstValue = block.nextInt();
}
public static short getId() {
return ParserIdentifier.LABELSST;
}
}