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

public final Class RecordFactory

extends Object
Class Inheritance
Imports
java.io.InputStream, java.util.ArrayList, .Arrays, .List, org.apache.poi.util.IOUtils, .RecordFormatException

Title: Record Factory

Description: Takes a stream and outputs an array of Record objects.

See Also
org.apache.poi.hssf.eventmodel.EventRecordFactory

Field Summary

Modifier and TypeField and Description
private static final int
private static int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static BlankRecord[]

Returns:

the equivalent array of BlankRecords
convertBlankRecords
(MulBlankRecord
the MulBlankRecord to convert
mbk
)

Converts a MulBlankRecord into an equivalent array of BlankRecords

public static NumberRecord[]

Returns:

the equivalent array of NumberRecords
convertRKRecords
(MulRKRecord
the MulRKRecord to convert
mrk
)

Converts a MulRKRecord into an equivalent array of NumberRecords

public static NumberRecord

Returns:

the NumberRecord
convertToNumberRecord
(RKRecord
the RK record to convert
rk
)

RK record is a slightly smaller alternative to NumberRecord POI likes NumberRecord better

public static Record[]

Returns:

the extracted records
createRecord
(RecordInputStream
the RecordInputStream to read from
in
)

create a record, if there are MUL records than multiple records are returned digested into the non-mul form.

public static List<Record>

Returns:

an array of Records created from the InputStream
createRecords
(InputStream
the InputStream from which the records will be obtained
in
)

Create an array of records from an input stream

public static Record
public static short[]

Returns:

an array of all the SIDS for all known records
getAllKnownRecordSIDs
()

public static int
public static Class<? extends Record>

Returns:

the POI implementation class for the specified record sid. null if the specified record is not interpreted by POI.
getRecordClass
(int
the record sid
sid
)

Debug / diagnosis method

Gets the POI implementation class for a given sid.

public static void
setMaxNumberOfRecords(int maxNumberOfRecords)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_MAX_NUMBER_OF_RECORDSback to summary
private static final int DEFAULT_MAX_NUMBER_OF_RECORDS
MAX_NUMBER_OF_RECORDSback to summary
private static int MAX_NUMBER_OF_RECORDS
NUM_RECORDSback to summary
private static final int NUM_RECORDS

Constructor Detail

RecordFactoryback to summary
private RecordFactory()

Method Detail

convertBlankRecordsback to summary
public static BlankRecord[] convertBlankRecords(MulBlankRecord mbk)

Converts a MulBlankRecord into an equivalent array of BlankRecords

Parameters
mbk:MulBlankRecord

the MulBlankRecord to convert

Returns:BlankRecord[]

the equivalent array of BlankRecords

convertRKRecordsback to summary
public static NumberRecord[] convertRKRecords(MulRKRecord mrk)

Converts a MulRKRecord into an equivalent array of NumberRecords

Parameters
mrk:MulRKRecord

the MulRKRecord to convert

Returns:NumberRecord[]

the equivalent array of NumberRecords

convertToNumberRecordback to summary
public static NumberRecord convertToNumberRecord(RKRecord rk)

RK record is a slightly smaller alternative to NumberRecord POI likes NumberRecord better

Parameters
rk:RKRecord

the RK record to convert

Returns:NumberRecord

the NumberRecord

createRecordback to summary
public static Record[] createRecord(RecordInputStream in)

create a record, if there are MUL records than multiple records are returned digested into the non-mul form.

Parameters
in:RecordInputStream

the RecordInputStream to read from

Returns:Record[]

the extracted records

createRecordsback to summary
public static List<Record> createRecords(InputStream in) throws RecordFormatException

Create an array of records from an input stream

Parameters
in:InputStream

the InputStream from which the records will be obtained

Returns:List<Record>

an array of Records created from the InputStream

Exceptions
RecordFormatException:
on error processing the InputStream
createSingleRecordback to summary
public static Record createSingleRecord(RecordInputStream in)
getAllKnownRecordSIDsback to summary
public static short[] getAllKnownRecordSIDs()
Returns:short[]

an array of all the SIDS for all known records

getMaxNumberOfRecordsback to summary
public static int getMaxNumberOfRecords()
getRecordClassback to summary
public static Class<? extends Record> getRecordClass(int sid)

Debug / diagnosis method

Gets the POI implementation class for a given sid. Only a subset of the BIFF records are actually interpreted by POI. A few others are known but not interpreted (see UnknownRecord#getBiffName(int)).

Parameters
sid:int

the record sid

Returns:Class<? extends Record>

the POI implementation class for the specified record sid. null if the specified record is not interpreted by POI.

setMaxNumberOfRecordsback to summary
public static void setMaxNumberOfRecords(int maxNumberOfRecords)