Package org.apache.poi.hssf.record
Class DConRefRecord
- 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.DConRefRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public class DConRefRecord extends StandardRecord
DConRef records specify a range in a workbook (internal or external) that serves as a data source for pivot tables or data consolidation. Represents aDConRef
Structure [MS-XLS s. 2.4.86], and the containedDConFile
structure [MS-XLS s. 2.5.69]. This in turn contains aXLUnicodeStringNoCch
[MS-XLS s. 2.5.296]._______________________________ | DConRef | (bytes) +-+-+-+-+-+-+-+-+-+-+...+-+-+-+-+ | ref |cch| stFile | un| +-+-+-+-+-+-+-+-+-+-+...+-+-+-+-+ | _________|_____________________ |DConFile / XLUnicodeStringNoCch| +-+-+-+-+-+-+-+-+-+-+-+...+-+-+-+ (bits) |h| reserved | rgb | +-+-+-+-+-+-+-+-+-+-+-+...+-+-+-+
WhereDConFile.h = 0x00
if the characters inrgb
are single byte, andDConFile.h = 0x01
if they are double byte.If they are double byte, then
- If it exists, the length of
DConRef.un = 2
. Otherwise it is 1. - The length of
DConFile.rgb = (2 * DConRef.cch)
. Otherwise it is equal toDConRef.cch
.
- If it exists, the length of
DConRef.rgb
starts with0x01
if it is an external reference, and with0x02
if it is a self-reference.
-
-
Field Summary
Fields Modifier and Type Field Description static short
sid
The id of the record type,sid = 81
-
Constructor Summary
Constructors Constructor Description DConRefRecord(byte[] data)
Read constructor.DConRefRecord(DConRefRecord other)
DConRefRecord(RecordInputStream inStream)
Read Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DConRefRecord
copy()
protected int
getDataSize()
int
getFirstColumn()
int
getFirstRow()
Map<String,Supplier<?>>
getGenericProperties()
HSSFRecordTypes
getGenericRecordType()
int
getLastColumn()
int
getLastRow()
byte[]
getPath()
String
getReadablePath()
short
getSid()
return the non static version of the id for this record.boolean
isExternalRef()
Checks if the data source in this reference record is external to this sheet or internal.protected void
serialize(LittleEndianOutput out)
Write the data content of this BIFF record.-
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
The id of the record type,sid = 81
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DConRefRecord
public DConRefRecord(DConRefRecord other)
-
DConRefRecord
public DConRefRecord(byte[] data)
Read constructor.- Parameters:
data
- byte array containing a DConRef Record, including the header.
-
DConRefRecord
public DConRefRecord(RecordInputStream inStream)
Read Constructor.- Parameters:
inStream
- RecordInputStream containing a DConRefRecord structure.
-
-
Method Detail
-
getDataSize
protected int getDataSize()
- Specified by:
getDataSize
in classStandardRecord
-
serialize
protected 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.
-
getFirstColumn
public int getFirstColumn()
- Returns:
- The first column of the range.
-
getFirstRow
public int getFirstRow()
- Returns:
- The first row of the range.
-
getLastColumn
public int getLastColumn()
- Returns:
- The last column of the range.
-
getLastRow
public int getLastRow()
- Returns:
- The last row of the range.
-
getPath
public byte[] getPath()
- Returns:
- raw path byte array.
-
getReadablePath
public String getReadablePath()
- Returns:
- the link's path, with the special characters stripped/replaced. May be null. See MS-XLS 2.5.277 (VirtualPath)
-
isExternalRef
public boolean isExternalRef()
Checks if the data source in this reference record is external to this sheet or internal.- Returns:
- true iff this is an external reference.
-
copy
public DConRefRecord 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
-
-