Methods Summary |
---|
public void | addInfoRecord(ExtSSTInfoSubRecord rec)
field_2_sst_info.add(rec);
|
protected void | fillFields(org.apache.poi.hssf.record.RecordInputStream in)
field_2_sst_info = new ArrayList();
field_1_strings_per_bucket = in.readShort();
while (in.remaining() > 0) {
ExtSSTInfoSubRecord rec = new ExtSSTInfoSubRecord(in);
field_2_sst_info.add(rec);
}
|
public ExtSSTInfoSubRecord | getInfoRecordAt(int elem)
return ( ExtSSTInfoSubRecord ) field_2_sst_info.get(elem);
|
public int | getNumInfoRecords()
return field_2_sst_info.size();
|
public short | getNumStringsPerBucket()
return field_1_strings_per_bucket;
|
public static final int | getNumberOfInfoRecsForStrings(int numStrings)
int infoRecs = (numStrings / DEFAULT_BUCKET_SIZE);
if ((numStrings % DEFAULT_BUCKET_SIZE) != 0)
infoRecs ++;
//Excel seems to max out after 128 info records.
//This isnt really documented anywhere...
if (infoRecs > MAX_BUCKETS)
infoRecs = MAX_BUCKETS;
return infoRecs;
|
public int | getRecordSize()Returns the size of this record
return 6 + 8*getNumInfoRecords();
|
public static final int | getRecordSizeForStrings(int numStrings)Given a number of strings (in the sst), returns the size of the extsst record
return 4 + 2 + (getNumberOfInfoRecsForStrings(numStrings) * 8);
|
public short | getSid()
return sid;
|
public int | serialize(int offset, byte[] data)
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
LittleEndian.putShort(data, 4 + offset, field_1_strings_per_bucket);
int pos = 6;
for (int k = 0; k < getNumInfoRecords(); k++)
{
ExtSSTInfoSubRecord rec = getInfoRecordAt(k);
pos += rec.serialize(pos + offset, data);
}
return pos;
|
public void | setBucketOffsets(int[] bucketAbsoluteOffsets, int[] bucketRelativeOffsets)
this.field_2_sst_info = new ArrayList(bucketAbsoluteOffsets.length);
for ( int i = 0; i < bucketAbsoluteOffsets.length; i++ )
{
ExtSSTInfoSubRecord r = new ExtSSTInfoSubRecord();
r.setBucketRecordOffset((short)bucketRelativeOffsets[i]);
r.setStreamPos(bucketAbsoluteOffsets[i]);
field_2_sst_info.add(r);
}
|
public void | setNumStringsPerBucket(short numStrings)
field_1_strings_per_bucket = numStrings;
|
public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer.append("[EXTSST]\n");
buffer.append(" .dsst = ")
.append(Integer.toHexString(getNumStringsPerBucket()))
.append("\n");
buffer.append(" .numInfoRecords = ").append(getNumInfoRecords())
.append("\n");
for (int k = 0; k < getNumInfoRecords(); k++)
{
buffer.append(" .inforecord = ").append(k).append("\n");
buffer.append(" .streampos = ")
.append(Integer
.toHexString(getInfoRecordAt(k).getStreamPos())).append("\n");
buffer.append(" .sstoffset = ")
.append(Integer
.toHexString(getInfoRecordAt(k).getBucketSSTOffset()))
.append("\n");
}
buffer.append("[/EXTSST]\n");
return buffer.toString();
|
protected void | validateSid(short id)
if (id != sid)
{
throw new RecordFormatException("NOT An EXTSST RECORD");
}
|