public abstract class AbstractDataReaderEngine extends java.lang.Object implements DataReaderEngine, java.io.Serializable
Constructor and Description |
---|
AbstractDataReaderEngine(ReadableDataLocation dataLocation,
SdmxBeanRetrievalManager beanRetrieval,
DataStructureBean defaultDsd,
DataflowBean dataflowBean,
ProvisionAgreementBean provisionAgreement)
Creates a reader engine based on the data location, the location of available data structures that can be used to retrieve dsds, and the default dsd to use
|
Modifier and Type | Method and Description |
---|---|
void |
copyToOutputStream(java.io.OutputStream outputStream)
Copies the entire dataset that the reader is reading, to the output stream (irrespective of current position)
|
java.lang.String |
getCrossSectionConcept() |
DatasetHeaderBean |
getCurrentDatasetHeaderBean()
Returns the header information for the current dataset.
|
Keyable |
getCurrentKey()
Returns the current Keyable entry in the dataset, if there has been no initial call to moveNextKeyable, then null will be returned.
|
Observation |
getCurrentObservation()
Returns the current Observation for the current Keyable.
|
DataflowBean |
getDataFlow()
Returns the dataflow that this reader engine is currently reading data for.
|
int |
getDatasetPosition()
Returns the current dataset index the iterator position is at within the data source.
|
DataStructureBean |
getDataStructure()
Returns the data structure definition that this reader engine is currently reading data for
Note this will return null unless there has been a call to moveNextDataset(), this DataStructure returned by this method call may change when reading a new dataset
|
HeaderBean |
getHeader()
Returns the header of the datasource that this reader engine is reading data for.
|
int |
getKeyablePosition()
Returns the current Keyable index the iterator position is at within the Data Set
Index starts at -1 - (no Keys have been Read)
|
int |
getObsPosition()
Returns the current Observation index the iterator position is at within the current Keyable being read.
|
ProvisionAgreementBean |
getProvisionAgreement()
Returns the provision agreement that this data is for.
|
int |
getSeriesPosition()
Returns the current Series index the iterator position is at within the Data Set
Index starts at -1 - (no Series Keys have been Read)
|
boolean |
isTimeSeries() |
boolean |
moveNextDataset()
Returns true if there are any more datasets in the data source
|
boolean |
moveNextKeyable()
Returns true if there are any more keys in the dataset
|
boolean |
moveNextObservation()
If this reader is in a series, this will return true if the series has any more observation values.
|
void |
reset()
Moves the read position back to the start of the Data Set (getKeyablePosition() moved back to -1)
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, createCopy, getDatasetAttributes
public AbstractDataReaderEngine(ReadableDataLocation dataLocation, SdmxBeanRetrievalManager beanRetrieval, DataStructureBean defaultDsd, DataflowBean dataflowBean, ProvisionAgreementBean provisionAgreement)
dataLocation
- the location of the databeanRetrieval
- giving the ability to retrieve dsds for the datasets this reader engine is reading. This can be null if there is only one relevant dsd - in which case the default dsd should be provideddefaultDsd
- the default dsd to use if the beanRetrieval is null, or if the bean retrieval does not return the dsd for the given datasetpublic void copyToOutputStream(java.io.OutputStream outputStream)
DataReaderEngine
copyToOutputStream
in interface DataReaderEngine
outputStream
- output stream to copy data topublic HeaderBean getHeader()
DataReaderEngine
getHeader
in interface DataReaderEngine
public int getDatasetPosition()
DataReaderEngine
getDatasetPosition
in interface DataReaderEngine
public DatasetHeaderBean getCurrentDatasetHeaderBean()
DataReaderEngine
getCurrentDatasetHeaderBean
in interface DataReaderEngine
public DataflowBean getDataFlow()
DataReaderEngine
getDataFlow
in interface DataReaderEngine
public ProvisionAgreementBean getProvisionAgreement()
DataReaderEngine
getProvisionAgreement
in interface DataReaderEngine
public boolean moveNextDataset()
DataReaderEngine
moveNextDataset
in interface DataReaderEngine
public DataStructureBean getDataStructure()
DataReaderEngine
getDataStructure
in interface DataReaderEngine
public final boolean moveNextKeyable()
DataReaderEngine
moveNextKeyable
in interface DataReaderEngine
public final boolean moveNextObservation()
DataReaderEngine
moveNextObservation
in interface DataReaderEngine
public final Observation getCurrentObservation()
DataReaderEngine
getCurrentObservation
in interface DataReaderEngine
public final Keyable getCurrentKey()
DataReaderEngine
getCurrentKey
in interface DataReaderEngine
public int getKeyablePosition()
DataReaderEngine
getKeyablePosition
in interface DataReaderEngine
public int getSeriesPosition()
DataReaderEngine
getSeriesPosition
in interface DataReaderEngine
public int getObsPosition()
DataReaderEngine
getObsPosition
in interface DataReaderEngine
public boolean isTimeSeries()
public java.lang.String getCrossSectionConcept()
public void reset()
DataReaderEngine
reset
in interface DataReaderEngine