public abstract class AbstractDataModelEventReader<M extends DataModel> extends Object implements DataModelEventReader<M>
DataModel
.Constructor and Description |
---|
AbstractDataModelEventReader(AlignmentDataReader mainReader,
DataModelFactory<M> factory)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createNewInfo(AlignmentModel<?> alignmentModel) |
protected void |
createNewInfo(AlignmentModel<?> alignmentModel,
String sequenceID) |
protected DataModelReadInfo<M> |
getCurrentInfo() |
DataModelFactory<M> |
getFactory()
Returns the factory used to create new data models in this instance.
|
AlignmentDataReader |
getMainReader()
Returns the instance of the main reader (for reading alignment and data models) which
uses this data model reader.
|
List<DataModelReadInfo<M>> |
getModels()
Returns the model objects that have been read from the underlying JPhyloIO event stream until now.
|
boolean |
isReadingInstance()
Determines whether this object contains an unpublished data model that is currently read.
|
protected void |
publishCurrentInfo()
Adds the current info object to the model list, if one is present.
|
public AbstractDataModelEventReader(AlignmentDataReader mainReader, DataModelFactory<M> factory)
mainReader
- the associates main reader instance forwarding to this readerfactory
- the factory to be used to create new data model instance during readingpublic AlignmentDataReader getMainReader()
DataModelEventReader
getMainReader
in interface DataModelEventReader<M extends DataModel>
protected void createNewInfo(AlignmentModel<?> alignmentModel)
protected void createNewInfo(AlignmentModel<?> alignmentModel, String sequenceID)
protected void publishCurrentInfo()
protected DataModelReadInfo<M> getCurrentInfo()
public boolean isReadingInstance()
getModels()
as soon as it is completely read.true
if an unpublished object is present, false
otherwise.public DataModelFactory<M> getFactory()
DataModelEventReader
getFactory
in interface DataModelEventReader<M extends DataModel>
null
)public List<DataModelReadInfo<M>> getModels()
DataModelEventReader
getModels
in interface DataModelEventReader<M extends DataModel>