Top Description Fields Constructors Methods
org.apache.poi.hssf.record

public final Class BoundSheetRecord

extends StandardRecord
Class Inheritance
Imports
java.util.Arrays, .List, .Map, java.util.function.Supplier, org.apache.poi.ss.util.WorkbookUtil, org.apache.poi.util.BitField, .BitFieldFactory, .GenericRecordUtil, .LittleEndian, .LittleEndianConsts, .LittleEndianOutput, .StringUtil

Defines a sheet within a workbook. Basically stores the sheet name and tells where the Beginning of file record is within the HSSF file.

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private String
private static final BitField
public static final short
private static final BitField

Constructor Summary

AccessConstructor and Description
public
public
public
BoundSheetRecord(RecordInputStream
the record stream to read from
in
)

UTF8: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 + 1 + 1 + len(str) UNICODE: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 + 1 + 1 + 2 * len(str)

Method Summary

Modifier and TypeMethod and Description
private static int
public BoundSheetRecord
protected int
public Map<String, Supplier<?>>
public HSSFRecordTypes
public int

Returns:

offset in bytes
getPositionOfBof
()

get the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file

public String

Returns:

sheetname the name of the sheet
getSheetname
()

get the sheetname for this sheet.

public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public boolean

Returns:

true if hidden
isHidden
()

Is the sheet hidden?

private boolean
public boolean

Returns:

true if very hidden
isVeryHidden
()

Is the sheet very hidden?

public static BoundSheetRecord[]

Returns:

the sorted boundSheetRecords
orderByBofPosition
(List<BoundSheetRecord>
the boundSheetRecord list to arrayify
boundSheetRecords
)

Converts a List of BoundSheetRecords to an array and sorts by the position of their BOFs.

public void
serialize(LittleEndianOutput
the output object
out
)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record.

public void
setHidden(boolean
true if hidden
hidden
)

Is the sheet hidden?

public void
setPositionOfBof(int
offset in bytes
pos
)

set the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file

public void
setSheetname(String
the name of the sheet
sheetName
)

Set the sheetname for this sheet.

public void
setVeryHidden(boolean
true if very hidden
veryHidden
)

Is the sheet very hidden?

Inherited from org.apache.poi.hssf.record.StandardRecord:
getRecordSizeserialize

Field Detail

field_1_position_of_BOFback to summary
private int field_1_position_of_BOF
field_2_option_flagsback to summary
private int field_2_option_flags
field_4_isMultibyteUnicodeback to summary
private int field_4_isMultibyteUnicode
field_5_sheetnameback to summary
private String field_5_sheetname
hiddenFlagback to summary
private static final BitField hiddenFlag
sidback to summary
public static final short sid
veryHiddenFlagback to summary
private static final BitField veryHiddenFlag

Constructor Detail

BoundSheetRecordback to summary
public BoundSheetRecord(String sheetname)
BoundSheetRecordback to summary
public BoundSheetRecord(BoundSheetRecord other)
BoundSheetRecordback to summary
public BoundSheetRecord(RecordInputStream in)

UTF8: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 + 1 + 1 + len(str) UNICODE: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 + 1 + 1 + 2 * len(str)

Parameters
in:RecordInputStream

the record stream to read from

Method Detail

compareRecordsback to summary
private static int compareRecords(BoundSheetRecord bsr1, BoundSheetRecord bsr2)
copyback to summary
public BoundSheetRecord copy()

Implements abstract org.apache.poi.hssf.record.StandardRecord.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Returns:BoundSheetRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getDataSizeback to summary
protected int getDataSize()

Implements abstract org.apache.poi.hssf.record.StandardRecord.getDataSize.

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getPositionOfBofback to summary
public int getPositionOfBof()

get the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file

Returns:int

offset in bytes

getSheetnameback to summary
public String getSheetname()

get the sheetname for this sheet. (this appears in the tabs at the bottom)

Returns:String

sheetname the name of the sheet

getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

isHiddenback to summary
public boolean isHidden()

Is the sheet hidden? Different from very hidden

Returns:boolean

true if hidden

isMultibyteback to summary
private boolean isMultibyte()
isVeryHiddenback to summary
public boolean isVeryHidden()

Is the sheet very hidden? Different from (normal) hidden

Returns:boolean

true if very hidden

orderByBofPositionback to summary
public static BoundSheetRecord[] orderByBofPosition(List<BoundSheetRecord> boundSheetRecords)

Converts a List of BoundSheetRecords to an array and sorts by the position of their BOFs.

Parameters
boundSheetRecords:List<BoundSheetRecord>

the boundSheetRecord list to arrayify

Returns:BoundSheetRecord[]

the sorted boundSheetRecords

serializeback to summary
public void serialize(LittleEndianOutput out)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Doc from org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields have already been written by the superclass.

The number of bytes written must equal the record size reported by org.apache.poi.hssf.record.Record#getRecordSize()} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).

Parameters
out:LittleEndianOutput

the output object

setHiddenback to summary
public void setHidden(boolean hidden)

Is the sheet hidden? Different from very hidden

Parameters
hidden:boolean

true if hidden

setPositionOfBofback to summary
public void setPositionOfBof(int pos)

set the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file

Parameters
pos:int

offset in bytes

setSheetnameback to summary
public void setSheetname(String sheetName)

Set the sheetname for this sheet. (this appears in the tabs at the bottom)

Parameters
sheetName:String

the name of the sheet

Exceptions
IllegalArgumentException:
if sheet name will cause excel to crash.
See Also
for a safe way to create valid names
setVeryHiddenback to summary
public void setVeryHidden(boolean veryHidden)

Is the sheet very hidden? Different from (normal) hidden

Parameters
veryHidden:boolean

true if very hidden