public final class SSTRecord extends ContinuableRecord
This holds all the strings for LabelSSTRecords.
(静态字符串表记录 (0x00FC) 这包含 LabelSSTRecords 的所有字符串。)LabelSSTRecord
,
ContinueRecord
Modifier and Type | Field and Description |
---|---|
static short |
sid |
Constructor and Description |
---|
SSTRecord() |
SSTRecord(RecordInputStream in)
Fill the fields from the data
|
SSTRecord(SSTRecord other) |
Modifier and Type | Method and Description |
---|---|
int |
addString(UnicodeString string)
Add a string.
(添加一个字符串。)
|
int |
calcExtSSTRecordSize()
Calculates the size in bytes of the EXTSST record as it would be if the record was serialized.
(计算 EXTSST 记录的大小(以字节为单位),就像记录被序列化时一样。)
|
SSTRecord |
copy() |
ExtSSTRecord |
createExtSSTRecord(int sstOffset)
Creates an extended string record based on the current contents of the current SST record.
(根据当前 SST 记录的当前内容创建扩展字符串记录。)
|
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
HSSFRecordTypes |
getGenericRecordType() |
int |
getNumStrings() |
int |
getNumUniqueStrings() |
short |
getSid()
return the non static version of the id for this record.
(返回此记录的 id 的非静态版本。)
|
UnicodeString |
getString(int id)
Get a particular string by its index
(通过索引获取特定字符串)
|
protected void |
serialize(ContinuableRecordOutput out)
Serializes this record's content to the supplied data output.
(将此记录的内容序列化为提供的数据输出。)
|
getRecordSize, serialize
cloneViaReserialise, serialize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGenericChildren
public static final short sid
public SSTRecord()
public SSTRecord(SSTRecord other)
public SSTRecord(RecordInputStream in)
The data consists of sets of string data. This string data is arranged as follows:
short string_length; // length of string data byte string_flag; // flag specifying special string // handling short run_count; // optional count of formatting runs int extend_length; // optional extension length char[] string_data; // string data, can be byte[] or // short[] (length of array is // string_length) int[] formatting_runs; // optional formatting runs (length of // array is run_count) byte[] extension; // optional extension (length of array // is extend_length)
The string_flag is bit mapped as follows:
Bit number | Meaning if 0 | Meaning if 1 |
---|---|---|
0 | string_data is byte[] | string_data is short[] |
1 | Should always be 0 | string_flag is defective |
2 | extension is not included | extension is included |
3 | formatting run data is not included | formatting run data is included |
4 | Should always be 0 | string_flag is defective |
5 | Should always be 0 | string_flag is defective |
6 | Should always be 0 | string_flag is defective |
7 | Should always be 0 | string_flag is defective |
We can handle eating the overhead associated with bits 2 or 3 (or both) being set, but we have no idea what to do with the associated data. The UnicodeString class can handle the byte[] vs short[] nature of the actual string data
(从数据中填充字段 数据由字符串数据集组成。该字符串数据排列如下:short string_length; // 字符串数据字节长度 string_flag; // 指定特殊字符串的标志 // 处理短 run_count; // 格式化运行的可选计数 int extend_length; // 可选扩展长度 char[] string_data; // 字符串数据,可以是 byte[] 或 // short[](数组长度为 // string_length) int[]formatting_runs; // 可选格式化运行( // 数组长度为 run_count) byte[] extension; // 可选扩展(数组的长度 // 是extend_length) string_flag 的位映射如下: 位号 含义 if 0 含义 if 1 0 string_data is byte[] string_data is short[] 1 应始终为 0 string_flag 有缺陷 2 扩展不包括扩展名 3 不包括格式化运行数据 包括格式化运行数据 4 应始终为 0 string_flag 有缺陷 5 应始终为 0 string_flag 有缺陷 6 应始终为 0 string_flag 有缺陷 7 应始终为 0 string_flag 有缺陷我们可以处理与设置的第 2 位或第 3 位(或两者)相关的开销,但我们不知道如何处理相关数据。 UnicodeString 类可以处理实际字符串数据的 byte[] vs short[] 性质)in
- the RecordInputStream to read the record from
(in - 要从中读取记录的 RecordInputStream)
public int addString(UnicodeString string)
string
- string to be added
(string - 要添加的字符串)
public int getNumStrings()
public int getNumUniqueStrings()
public UnicodeString getString(int id)
id
- index into the array of strings
(id - 字符串数组的索引)
public short getSid()
Record
protected void serialize(ContinuableRecordOutput out)
ContinuableRecord
The standard BIFF header (ushort sid, ushort size) has been handled by the superclass, so only BIFF data should be written by this method. Simple data types can be written with the standard LittleEndianOutput
methods. Methods from ContinuableRecordOutput
can be used to serialize strings (with ContinueRecord
s being written as required). If necessary, implementors can explicitly start ContinueRecord
s (regardless of the amount of remaining space).
serialize
in class
ContinuableRecord
(在类 ContinuableRecord 中序列化)
out
- a data output stream
(out - 数据输出流)
public ExtSSTRecord createExtSSTRecord(int sstOffset)
NOTE: THIS FUNCTION MUST ONLY BE CALLED AFTER THE SST RECORD HAS BEEN SERIALIZED.
(根据当前 SST 记录的当前内容创建扩展字符串记录。流中到 SST 记录的偏移量是必需的,因为扩展字符串记录直接指向 SST 记录中的字符串。注意:这个函数只能在 SST 记录被序列化后调用。)sstOffset
- The offset in the stream to the start of the SST record.
(sstOffset - 流中到 SST 记录开头的偏移量。)
public int calcExtSSTRecordSize()
public SSTRecord copy()
copy
in interface
Duplicatable
(复制到界面 Duplicatable)
copy
in class
Record
(复制课堂记录)
public HSSFRecordTypes getGenericRecordType()
getGenericRecordType
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericRecordType)
getGenericRecordType
in class
Record
(类 Record 中的 getGenericRecordType)
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.