public class ReaderStreamDataProvider<R extends AbstractEventReader<? extends ReaderStreamDataProvider<R>>> extends java.lang.Object
NewickStringReader
or element readers for XML formats). They have two major functions:
AbstractEventReader.getStreamDataProvider()
,
AbstractEventReader.createStreamDataProvider()
Constructor and Description |
---|
ReaderStreamDataProvider(R eventReader) |
Modifier and Type | Method and Description |
---|---|
boolean |
eventsUpcoming()
Checks whether events are waiting the event queue of the associated event reader.
|
java.util.Collection<JPhyloIOEvent> |
getCurrentEventCollection()
Returns the event collection that is currently used to take up new events.
|
R |
getEventReader() |
LongIDManager |
getIDManager()
Returns the ID manager of the associated reader.
|
ReadWriteParameterMap |
getParameters()
Returns the parameter map that was specified when the constructor of the associated reader was called.
|
SequenceTokensEventManager |
getSequenceTokensEventManager()
Returns the sequence tokens event manager of the associated reader.
|
boolean |
hasSpecialEventCollection()
Determines whether the current event collection is different from the queue of upcoming events.
|
java.util.Collection<JPhyloIOEvent> |
resetCurrentEventCollection()
Removes the event collection at the top of the eventCollections stack and returns it.
|
java.util.Collection<JPhyloIOEvent> |
setCurrentEventCollection(java.util.Collection<JPhyloIOEvent> newCollection)
Adds a new current event collection to the stack.
|
public ReaderStreamDataProvider(R eventReader)
public R getEventReader()
public java.util.Collection<JPhyloIOEvent> resetCurrentEventCollection()
public java.util.Collection<JPhyloIOEvent> setCurrentEventCollection(java.util.Collection<JPhyloIOEvent> newCollection)
newCollection
- the new collection to take up new events from now onjava.lang.NullPointerException
- if newCollection
is null
public java.util.Collection<JPhyloIOEvent> getCurrentEventCollection()
public boolean hasSpecialEventCollection()
false
if getCurrentEventCollection()
returns the same instance as #getUpcomingEvents()
or true
otherwisepublic boolean eventsUpcoming()
Note that this event queue maybe different from the getCurrentEventCollection()
. Therefore
this method may return false
, even if an event has just been added.
true
if at least one event is wainting, false
otherwisepublic SequenceTokensEventManager getSequenceTokensEventManager()
public ReadWriteParameterMap getParameters()
public LongIDManager getIDManager()