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

public Class ExternSheetRecord

extends StandardRecord
Class Inheritance
Imports
java.util.ArrayList, .List, .Map, java.util.function.Supplier, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.util.GenericRecordJsonWriter, .GenericRecordUtil, .LittleEndianOutput

EXTERNSHEET (0x0017)

A List of Indexes to EXTERNALBOOK (supplemental book) Records

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final List<ExternSheetRecord.RefSubRecord>
public static final short

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

index of newly added ref
addRef
(int
the external book block index
extBookIndex
,
int
the scope, must be -2 for add-in references
firstSheetIndex
,
int
the scope, must be -2 for add-in references
lastSheetIndex
)

Add a zero-based reference to a org.apache.poi.hssf.record.SupBookRecord.

public void
addREFRecord(ExternSheetRecord.RefSubRecord
REF struct
rec
)

adds REF struct (ExternSheetSubRecord)

public static ExternSheetRecord
public ExternSheetRecord
public int

Returns:

-1 if not found
findRefIndexFromExtBookIndex
(int
external sheet reference index
extBookIndex
)

protected int
public int

Returns:

the index of the SupBookRecord for this index
getExtbookIndexFromRefIndex
(int
specifies the n-th refIndex
refIndex
)

public int

Returns:

the first sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped
getFirstSheetIndexFromRefIndex
(int
external sheet reference index
extRefIndex
)

Returns the first sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped.

public Map<String, Supplier<?>>
public HSSFRecordTypes
public int

Returns:

the last sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped.
getLastSheetIndexFromRefIndex
(int
external sheet reference index
extRefIndex
)

Returns the last sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped.

public int

Returns:

number of REF records
getNumOfREFRecords
()

returns the number of REF Records, which is in model

public int

Returns:

number of REF structures
getNumOfRefs
()

private ExternSheetRecord.RefSubRecord
getRef(int i)

public int
getRefIxForSheet(int externalBookIndex, int firstSheetIndex, int lastSheetIndex)

public short
getSid()

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

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

public void
removeSheet(int sheetIdx)

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.

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

Field Detail

_listback to summary
private final List<ExternSheetRecord.RefSubRecord> _list
sidback to summary
public static final short sid

Constructor Detail

ExternSheetRecordback to summary
public ExternSheetRecord()
ExternSheetRecordback to summary
public ExternSheetRecord(ExternSheetRecord other)
ExternSheetRecordback to summary
public ExternSheetRecord(RecordInputStream in)

Method Detail

addRefback to summary
public int addRef(int extBookIndex, int firstSheetIndex, int lastSheetIndex)

Add a zero-based reference to a org.apache.poi.hssf.record.SupBookRecord.

If the type of the SupBook record is same-sheet referencing, Add-In referencing, DDE data source referencing, or OLE data source referencing, then no scope is specified and this value MUST be -2. Otherwise, the scope must be set as follows:

  1. -2 Workbook-level reference that applies to the entire workbook.
  2. -1 Sheet-level reference.
  3. >=0 Sheet-level reference. This specifies the first sheet in the reference.

    If the SupBook type is unused or external workbook referencing, then this value specifies the zero-based index of an external sheet name, see org.apache.poi.hssf.record.SupBookRecord#getSheetNames(). This referenced string specifies the name of the first sheet within the external workbook that is in scope. This sheet MUST be a worksheet or macro sheet.

    If the supporting link type is self-referencing, then this value specifies the zero-based index of a org.apache.poi.hssf.record.BoundSheetRecord record in the workbook stream that specifies the first sheet within the scope of this reference. This sheet MUST be a worksheet or a macro sheet.

Parameters
extBookIndex:int

the external book block index

firstSheetIndex:int

the scope, must be -2 for add-in references

lastSheetIndex:int

the scope, must be -2 for add-in references

Returns:int

index of newly added ref

addREFRecordback to summary
public void addREFRecord(ExternSheetRecord.RefSubRecord rec)

adds REF struct (ExternSheetSubRecord)

Parameters
rec:ExternSheetRecord.RefSubRecord

REF struct

combineback to summary
public static ExternSheetRecord combine(ExternSheetRecord[] esrs)
copyback to summary
public ExternSheetRecord copy()

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

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

Returns:ExternSheetRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
findRefIndexFromExtBookIndexback to summary
public int findRefIndexFromExtBookIndex(int extBookIndex)
Parameters
extBookIndex:int

external sheet reference index

Returns:int

-1 if not found

getDataSizeback to summary
protected int getDataSize()

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

Annotations
@Override
getExtbookIndexFromRefIndexback to summary
public int getExtbookIndexFromRefIndex(int refIndex)
Parameters
refIndex:int

specifies the n-th refIndex

Returns:int

the index of the SupBookRecord for this index

getFirstSheetIndexFromRefIndexback to summary
public int getFirstSheetIndexFromRefIndex(int extRefIndex)

Returns the first sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped.

Parameters
extRefIndex:int

external sheet reference index

Returns:int

the first sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped

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
getLastSheetIndexFromRefIndexback to summary
public int getLastSheetIndexFromRefIndex(int extRefIndex)

Returns the last sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped. For a single sheet reference, the first and last should be the same.

Parameters
extRefIndex:int

external sheet reference index

Returns:int

the last sheet that the reference applies to, or -1 if the referenced sheet can't be found, or -2 if the reference is workbook scoped.

getNumOfREFRecordsback to summary
public int getNumOfREFRecords()

returns the number of REF Records, which is in model

Returns:int

number of REF records

getNumOfRefsback to summary
public int getNumOfRefs()
Returns:int

number of REF structures

getRefback to summary
private ExternSheetRecord.RefSubRecord getRef(int i)
getRefIxForSheetback to summary
public int getRefIxForSheet(int externalBookIndex, int firstSheetIndex, int lastSheetIndex)
getSidback to summary
public short getSid()

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

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

Returns:short

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

he id for this record

Annotations
@Override
removeSheetback to summary
public void removeSheet(int sheetIdx)
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

Annotations
@Override
org.apache.poi.hssf.record back to summary

private final Class ExternSheetRecord.RefSubRecord

extends Object
implements GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord

Field Summary

Modifier and TypeField and Description
private final int
_extBookIndex

index to External Book Block (which starts with a EXTERNALBOOK record)

private int
private int
public static final int

Constructor Summary

AccessConstructor and Description
public
RefSubRecord(int extBookIndex, int firstSheetIndex, int lastSheetIndex)

public
public
RefSubRecord(RecordInputStream
the RecordInputstream to read the record from
in
)

Method Summary

Modifier and TypeMethod and Description
public int
public int
public Map<String, Supplier<?>>
public int
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_extBookIndexback to summary
private final int _extBookIndex

index to External Book Block (which starts with a EXTERNALBOOK record)

_firstSheetIndexback to summary
private int _firstSheetIndex
_lastSheetIndexback to summary
private int _lastSheetIndex
ENCODED_SIZEback to summary
public static final int ENCODED_SIZE

Constructor Detail

RefSubRecordback to summary
public RefSubRecord(int extBookIndex, int firstSheetIndex, int lastSheetIndex)
RefSubRecordback to summary
public RefSubRecord(ExternSheetRecord.RefSubRecord other)
RefSubRecordback to summary
public RefSubRecord(RecordInputStream in)
Parameters
in:RecordInputStream

the RecordInputstream to read the record from

Method Detail

getExtBookIndexback to summary
public int getExtBookIndex()
getFirstSheetIndexback to summary
public int getFirstSheetIndex()
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

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

Annotations
@Override
getLastSheetIndexback to summary
public int getLastSheetIndex()
serializeback to summary
public void serialize(LittleEndianOutput out)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override