Package org.apache.poi.hssf.record
Class SubRecord
- java.lang.Object
-
- org.apache.poi.hssf.record.SubRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
- Direct Known Subclasses:
CommonObjectDataSubRecord
,EmbeddedObjectRefSubRecord
,EndSubRecord
,FtCblsSubRecord
,FtCfSubRecord
,FtPioGrbitSubRecord
,GroupMarkerSubRecord
,LbsDataSubRecord
,NoteStructureSubRecord
public abstract class SubRecord extends Object implements Duplicatable, GenericRecord
Subrecords are part of the OBJ class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubRecord.SubRecordTypes
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SubRecord
copy()
static SubRecord
createSubRecord(LittleEndianInput in, int cmoOt)
read a sub-record from the supplied streamprotected abstract int
getDataSize()
abstract SubRecord.SubRecordTypes
getGenericRecordType()
static int
getMaxRecordLength()
boolean
isTerminating()
Whether this record terminates the sub-record stream.byte[]
serialize()
abstract void
serialize(LittleEndianOutput out)
static void
setMaxRecordLength(int length)
String
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, getGenericProperties
-
-
-
-
Constructor Detail
-
SubRecord
protected SubRecord()
-
SubRecord
protected SubRecord(SubRecord other)
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length
- the max record length allowed for SubRecord
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for SubRecord
-
createSubRecord
public static SubRecord createSubRecord(LittleEndianInput in, int cmoOt)
read a sub-record from the supplied stream- Parameters:
in
- the stream to read fromcmoOt
- the objectType field of the containing CommonObjectDataSubRecord, we need it to propagate to next sub-records as it defines what data follows- Returns:
- the created sub-record
-
getDataSize
protected abstract int getDataSize()
- Returns:
- the size of the data for this record (which is always 4 bytes less than the total record size). Note however, that ushort encoded after the record sid is usually but not always the data size.
-
serialize
public byte[] serialize()
-
serialize
public abstract void serialize(LittleEndianOutput out)
-
isTerminating
public boolean isTerminating()
Whether this record terminates the sub-record stream. There are two cases when this method must be overridden and returntrue
- EndSubRecord (sid = 0x00) - LbsDataSubRecord (sid = 0x12)- Returns:
- whether this record is the last in the sub-record stream
-
copy
public abstract SubRecord copy()
- Specified by:
copy
in interfaceDuplicatable
- Returns:
- a deep copy of the implementing class / instance
-
getGenericRecordType
public abstract SubRecord.SubRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
-
-