Package loci.poi.hssf.eventmodel
Class EventRecordFactory
java.lang.Object
loci.poi.hssf.eventmodel.EventRecordFactory
Event-based record factory. As opposed to RecordFactory
this refactored version throws record events as it comes
accross the records. I throws the "lazily" one record behind
to ensure that ContinueRecords are processed first.
- Author:
- Andrew C. Oliver (acoliver@apache.org) - probably to blame for the bugs (so yank his chain on the list), Marc Johnson (mjohnson at apache dot org) - methods taken from RecordFactory, Glen Stampoultzis (glens at apache.org) - methods taken from RecordFactory, Csaba Nagy (ncsaba at yahoo dot com)
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an abortable EventRecordFactory.EventRecordFactory(boolean abortable) Create an EventRecordFactory -
Method Summary
Modifier and TypeMethodDescriptionstatic Record[]create a record, if there are MUL records than multiple records are returned digested into the non-mul form.static short[]protected Iteratorused for unit tests to test the registration of record listeners.voidCreate an array of records from an input streamvoidregisterListener(ERFListener listener, short[] sids) Register a listener for records.
-
Constructor Details
-
EventRecordFactory
public EventRecordFactory()Construct an abortable EventRecordFactory. The same as calling new EventRecordFactory(true)- See Also:
-
EventRecordFactory
public EventRecordFactory(boolean abortable) Create an EventRecordFactory- Parameters:
abortable- specifies whether the return from the listener handler functions are obeyed. False means they are ignored. True means the event loop exits on error.
-
-
Method Details
-
registerListener
Register a listener for records. These can be for all records or just a subset.- Parameters:
sids- an array of Record.sid values identifying the records the listener will work with. Alternatively if this is "null" then all records are passed.
-
listeners
used for unit tests to test the registration of record listeners.- Returns:
- Iterator of ERFListeners
-
processRecords
Create an array of records from an input stream- Parameters:
in- the InputStream from which the records will be obtained- Throws:
RecordFormatException- on error processing the InputStream
-
createRecord
create a record, if there are MUL records than multiple records are returned digested into the non-mul form. -
getAllKnownRecordSIDs
public static short[] getAllKnownRecordSIDs()- Returns:
- an array of all the SIDS for all known records
-