public class AlignmentModelEventReader extends java.lang.Object implements info.bioinfweb.jphyloio.push.JPhyloIOEventListener
AlignmentDataReader
would be used instead.AlignmentDataReader
Constructor and Description |
---|
AlignmentModelEventReader()
Creates a new instance of this class using
StringAlignmentModelFactory as the default factory
and DoubleAlignmentModelFactory as the factory for continuous data. |
AlignmentModelEventReader(AlignmentModelFactory<?> defaultFactory)
Creates a new instance of this class with an empty factory map.
|
AlignmentModelEventReader(AlignmentModelFactory<?> defaultFactory,
java.util.Map<CharacterStateSetType,AlignmentModelFactory> factoryMap)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<AlignmentModel<?>> |
getCompletedModels()
Returns the list of alignment models that have been completely read from the underlying JPhyloIO
event stream until now.
|
java.lang.String |
getCurrentAlignmentID()
Returns the JPhyloIO ID of the alignment model that is currently read and returned by
getCurrentModel() . |
ConcatenatedAlignmentModel |
getCurrentConcatenatedModel()
Returns the concatenated model that is currently read by this instance.
|
AlignmentModel<?> |
getCurrentModel()
Returns the alignment model that is currently read.
|
AlignmentModelFactory<?> |
getDefaultFactory()
Returns the alignment model factory that is used to create new model instances for character state (token)
set types which are not defined in the factory map.
|
java.util.Map<CharacterStateSetType,AlignmentModelFactory> |
getFactoryMap()
Returns the map of alignment model factories for different character state (token) set types.
|
AlignmentModel<?> |
getModelByJPhyloIOID(java.lang.String id)
Returns the alignment model associated with the specified JPhyloIO ID.
|
boolean |
hasCurrentConcatenatedModel()
Checks if a concatenated alignment model is currently read by this instance.
|
boolean |
hasCurrentModel()
Checks whether an alignment model that is currently filled with data from the stream is present.
|
void |
processEvent(info.bioinfweb.jphyloio.JPhyloIOEventReader source,
info.bioinfweb.jphyloio.events.JPhyloIOEvent event) |
void |
setNucleotideFactories(AlignmentModelFactory<?> factory)
Sets the specified map for all nucleotide factories (identified with the keys
CharacterStateSetType.NUCLEOTIDE , CharacterStateSetType.DNA , CharacterStateSetType.RNA ). |
public AlignmentModelEventReader()
StringAlignmentModelFactory
as the default factory
and DoubleAlignmentModelFactory
as the factory for continuous data.public AlignmentModelEventReader(AlignmentModelFactory<?> defaultFactory)
getFactoryMap()
.defaultFactory
- the factory to use to create new model instances for character state (token)
set types which are not defined in the factory mappublic AlignmentModelEventReader(AlignmentModelFactory<?> defaultFactory, java.util.Map<CharacterStateSetType,AlignmentModelFactory> factoryMap)
defaultFactory
- the factory to use to create new model instances for character state (token) set types
which are not defined in the factory mapfactoryMap
- a map of alignment model factories for different character state (token) set typespublic AlignmentModelFactory<?> getDefaultFactory()
getFactoryMap()
public java.util.Map<CharacterStateSetType,AlignmentModelFactory> getFactoryMap()
getDefaultFactory()
public void setNucleotideFactories(AlignmentModelFactory<?> factory)
CharacterStateSetType.NUCLEOTIDE
, CharacterStateSetType.DNA
, CharacterStateSetType.RNA
).
Previously defined factories for the according types are replaced by this operation.
factory
- the alignment model factory to be used for all nucleotide token set typespublic AlignmentModel<?> getCurrentModel()
getCompletedModels()
and
this method will return null
until the next alignment is reached in the stream.null
if the current stream position is not between an
alignment start and end eventpublic java.lang.String getCurrentAlignmentID()
getCurrentModel()
.null
if no model is currently readpublic ConcatenatedAlignmentModel getCurrentConcatenatedModel()
null
if the model currently read is not an concatenated model
or not model currently is readhasCurrentConcatenatedModel()
,
getCurrentModel()
public boolean hasCurrentConcatenatedModel()
true
if a concatenated model is currently read, false
if no model is read or the
current model is not a concatenated instancepublic boolean hasCurrentModel()
true
if an alignment model is currently present, false
otherwise.public java.util.List<AlignmentModel<?>> getCompletedModels()
null
)public AlignmentModel<?> getModelByJPhyloIOID(java.lang.String id)
id
- the JPhyloIO of the alignment modelnull
is no model associated with the specified ID has yet been
started to be loadedpublic void processEvent(info.bioinfweb.jphyloio.JPhyloIOEventReader source, info.bioinfweb.jphyloio.events.JPhyloIOEvent event)
processEvent
in interface info.bioinfweb.jphyloio.push.JPhyloIOEventListener