Package org.apache.poi.hssf.record
Class BoundSheetRecord
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.Record
-
- org.apache.poi.hssf.record.StandardRecord
-
- org.apache.poi.hssf.record.BoundSheetRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public final class BoundSheetRecord extends StandardRecord
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
Fields Modifier and Type Field Description static short
sid
-
Constructor Summary
Constructors Constructor Description BoundSheetRecord(String sheetname)
BoundSheetRecord(BoundSheetRecord other)
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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundSheetRecord
copy()
protected int
getDataSize()
Map<String,Supplier<?>>
getGenericProperties()
HSSFRecordTypes
getGenericRecordType()
int
getPositionOfBof()
get the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS fileString
getSheetname()
get the sheetname for this sheet.short
getSid()
return the non static version of the id for this record.boolean
isHidden()
Is the sheet hidden? Different from very hiddenboolean
isVeryHidden()
Is the sheet very hidden? Different from (normal) hiddenstatic BoundSheetRecord[]
orderByBofPosition(List<BoundSheetRecord> boundSheetRecords)
Converts a List ofBoundSheetRecord
s to an array and sorts by the position of their BOFs.void
serialize(LittleEndianOutput out)
Write the data content of this BIFF record.void
setHidden(boolean hidden)
Is the sheet hidden? Different from very hiddenvoid
setPositionOfBof(int pos)
set the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS filevoid
setSheetname(String sheetName)
Set the sheetname for this sheet.void
setVeryHidden(boolean veryHidden)
Is the sheet very hidden? Different from (normal) hidden-
Methods inherited from class org.apache.poi.hssf.record.StandardRecord
getRecordSize, serialize
-
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BoundSheetRecord
public BoundSheetRecord(String sheetname)
-
BoundSheetRecord
public BoundSheetRecord(BoundSheetRecord other)
-
BoundSheetRecord
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
- the record stream to read from
-
-
Method Detail
-
setPositionOfBof
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
- offset in bytes
-
setSheetname
public void setSheetname(String sheetName)
Set the sheetname for this sheet. (this appears in the tabs at the bottom)- Parameters:
sheetName
- the name of the sheet- Throws:
IllegalArgumentException
- if sheet name will cause excel to crash.- See Also:
for a safe way to create valid names
-
getPositionOfBof
public int getPositionOfBof()
get the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file- Returns:
- offset in bytes
-
getSheetname
public String getSheetname()
get the sheetname for this sheet. (this appears in the tabs at the bottom)- Returns:
- sheetname the name of the sheet
-
getDataSize
protected int getDataSize()
- Specified by:
getDataSize
in classStandardRecord
-
serialize
public void serialize(LittleEndianOutput out)
Description copied from class:StandardRecord
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
RecordBase.getRecordSize()
} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).- Specified by:
serialize
in classStandardRecord
- Parameters:
out
- the output object
-
getSid
public short getSid()
Description copied from class:Record
return the non static version of the id for this record.
-
isHidden
public boolean isHidden()
Is the sheet hidden? Different from very hidden- Returns:
true
if hidden
-
setHidden
public void setHidden(boolean hidden)
Is the sheet hidden? Different from very hidden- Parameters:
hidden
-true
if hidden
-
isVeryHidden
public boolean isVeryHidden()
Is the sheet very hidden? Different from (normal) hidden- Returns:
true
if very hidden
-
setVeryHidden
public void setVeryHidden(boolean veryHidden)
Is the sheet very hidden? Different from (normal) hidden- Parameters:
veryHidden
-true
if very hidden
-
orderByBofPosition
public static BoundSheetRecord[] orderByBofPosition(List<BoundSheetRecord> boundSheetRecords)
Converts a List ofBoundSheetRecord
s to an array and sorts by the position of their BOFs.- Parameters:
boundSheetRecords
- the boundSheetRecord list to arrayify- Returns:
- the sorted boundSheetRecords
-
copy
public BoundSheetRecord copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classStandardRecord
- Returns:
- a deep copy of the implementing class / instance
-
getGenericRecordType
public HSSFRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
- Specified by:
getGenericRecordType
in classRecord
-
-