public class NeXMLReaderStreamDataProvider extends XMLReaderStreamDataProvider<NeXMLEventReader>
AbstractNeXMLElementReader
reading from the same document.Constructor and Description |
---|
NeXMLReaderStreamDataProvider(NeXMLEventReader nexmlEventReader) |
Modifier and Type | Method and Description |
---|---|
void |
clearCurrentRowInformation()
Method used for reading cell tags that clears the map of buffered cell informations (
getCurrentCellsBuffer() ) and resets
the columns ID iterator used by nextCharID() . |
URIOrStringIdentifier |
getAdditionalResourceMetaRel()
Returns a {link URIOrStringIdentifier} if an additional
ResourceMetadataEvent is to be created to enclose
meta data of elements without a JPhyloIOEvent representation or null if this the enclosing event
was already generated. |
java.lang.String |
getAlternativeStringRepresentation()
Returns the value of the content attribute of the current literal meta element to be used as an alternative
string representation by a following
LiteralMetadataContentEvent . |
java.util.List<java.lang.String> |
getCharIDs()
Returns a list of column IDs obtained from NeXML char elements.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getCharIDToIndexMap()
Returns a map linking column indices to column IDs obtained from NeXML char elements.
|
java.util.Map<java.lang.String,java.lang.String> |
getCharIDToStatesMap()
Returns a map linking a token set definition ID to a column ID obtained from a NeXML char elements.
|
java.util.Map<java.lang.String,BufferedEventInfo<SingleSequenceTokenEvent>> |
getCurrentCellsBuffer()
The returned map is used to buffer
SingleTokenDefinitionEvent s and their nested events, in cases where the order of
cell tags does not match the order of the referenced columns. |
java.lang.String |
getCurrentExpectedCharID()
Returns the column ID that has been the result of the last call of
nextCharID() . |
LiteralContentSequenceType |
getCurrentLiteralContentSequenceType()
Returns the
LiteralContentSequenceType of the content nested under the current literal meta element. |
NeXMLSingleTokenDefinitionInformation |
getCurrentSingleTokenDefinition()
Returns the
NeXMLSingleTokenDefinitionInformation instance of the currently read single token definition,
e.g to add more constituents. |
java.util.EnumMap<EventContentType,java.lang.String> |
getElementTypeToCurrentIDMap()
Returns a map that links the currently used ID to an
EventContentType . |
NeXMLEventReader |
getEventReader() |
java.util.Stack<EventContentType> |
getMetaType()
Returns a stack of
EventContentType that represents the currently encountered nested meta events. |
java.util.Map<java.lang.String,java.lang.String> |
getOTUIDToLabelMap()
Returns a map that links a label to a certain OTU ID.
|
java.util.Map<java.lang.String,java.lang.String> |
getTokenDefinitionIDToSymbolMap()
Returns a map that links a symbol (i.e.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getTokenSetIDtoColumnsMap()
Returns a map that links a symbol (i.e.
|
java.util.Map<java.lang.String,NeXMLReaderTokenSetInformation> |
getTokenSets()
Returns a map that links a
NeXMLReaderTokenSetInformation to a certain token set ID. |
boolean |
isAllowLongTokens() |
boolean |
isCurrentCellBuffered()
Determines whether the contents of the current
cell tag are buffered or not. |
boolean |
isCurrentSetSupported()
Returns
true if the set element that is currently read can be interpreted as a series of JPhyloIOEvent s
or false if the set and all its contents will be ignored. |
java.lang.String |
nextCharID()
Returns the next NeXML columns ID (ID of a
char tag) at the current position of the underlying iterator and stores it
in the property getCurrentExpectedCharID() . |
void |
setAdditionalResourceMetaRel(URIOrStringIdentifier additionalResourceMetaRel) |
void |
setAllowLongTokens(boolean allowLongTokens) |
void |
setAlternativeStringRepresentation(java.lang.String alternativeStringRepresentation) |
void |
setCurrentCellBuffered(boolean currentCellBuffered)
Allow to specify whether the contents of the current
cell tag are buffered or not. |
void |
setCurrentLiteralContentSequenceType(LiteralContentSequenceType currentLiteralContentSequenceType) |
void |
setCurrentSetIsSupported(boolean currentSetIsSupported) |
void |
setCurrentSingleTokenDefinition(NeXMLSingleTokenDefinitionInformation currentSingleTokenDefinition) |
getCharacterSetType, getEdgeInfos, getElementName, getIncompleteToken, getNestedMetaNames, getParentName, getSourceNode, getStartDocumentEvent, getXMLReader, hasIncompleteToken, isCreateNodeStart, isCustomXMLStartWritten, isRootedPhylogeny, setCharacterSetType, setCreateNodeStart, setCustomXMLStartWritten, setElementName, setIncompleteToken, setParentName, setRootedPhylogeny, setStartDocumentEvent
eventsUpcoming, getCurrentEventCollection, getIDManager, getParameters, getSequenceTokensEventManager, hasSpecialEventCollection, resetCurrentEventCollection, setCurrentEventCollection
public NeXMLReaderStreamDataProvider(NeXMLEventReader nexmlEventReader)
public NeXMLEventReader getEventReader()
getEventReader
in class ReaderStreamDataProvider<NeXMLEventReader>
public boolean isAllowLongTokens()
public void setAllowLongTokens(boolean allowLongTokens)
public java.util.EnumMap<EventContentType,java.lang.String> getElementTypeToCurrentIDMap()
EventContentType
. This map is used to determine a the linked ID of a set.EventContentType
public java.util.Stack<EventContentType> getMetaType()
EventContentType
that represents the currently encountered nested meta events.public LiteralContentSequenceType getCurrentLiteralContentSequenceType()
LiteralContentSequenceType
of the content nested under the current literal meta element.LiteralContentSequenceType
of the content nested under the current literal meta elementpublic void setCurrentLiteralContentSequenceType(LiteralContentSequenceType currentLiteralContentSequenceType)
public java.lang.String getAlternativeStringRepresentation()
LiteralMetadataContentEvent
.public void setAlternativeStringRepresentation(java.lang.String alternativeStringRepresentation)
public URIOrStringIdentifier getAdditionalResourceMetaRel()
ResourceMetadataEvent
is to be created to enclose
meta data of elements without a JPhyloIOEvent
representation or null
if this the enclosing event
was already generated.null
public void setAdditionalResourceMetaRel(URIOrStringIdentifier additionalResourceMetaRel)
public boolean isCurrentSetSupported()
true
if the set element that is currently read can be interpreted as a series of JPhyloIOEvent
s
or false
if the set and all its contents will be ignored.true
if the set currently read can be interpreted as a series of JPhyloIOEvent
spublic void setCurrentSetIsSupported(boolean currentSetIsSupported)
public java.util.Map<java.lang.String,java.lang.String> getOTUIDToLabelMap()
public java.util.Map<java.lang.String,NeXMLReaderTokenSetInformation> getTokenSets()
NeXMLReaderTokenSetInformation
to a certain token set ID.
This is used to buffer information about the token set until the start event is created and to be able
to find the right translation map when reading sequences.NeXMLReaderTokenSetInformation
to an token set IDpublic java.util.Map<java.lang.String,java.lang.String> getTokenDefinitionIDToSymbolMap()
public NeXMLSingleTokenDefinitionInformation getCurrentSingleTokenDefinition()
NeXMLSingleTokenDefinitionInformation
instance of the currently read single token definition,
e.g to add more constituents.NeXMLSingleTokenDefinitionInformation
instance of the currently read single token definitionpublic void setCurrentSingleTokenDefinition(NeXMLSingleTokenDefinitionInformation currentSingleTokenDefinition)
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getTokenSetIDtoColumnsMap()
public java.util.List<java.lang.String> getCharIDs()
public java.util.Map<java.lang.String,java.lang.Integer> getCharIDToIndexMap()
public java.util.Map<java.lang.String,java.lang.String> getCharIDToStatesMap()
public java.util.Map<java.lang.String,BufferedEventInfo<SingleSequenceTokenEvent>> getCurrentCellsBuffer()
SingleTokenDefinitionEvent
s and their nested events, in cases where the order of
cell
tags does not match the order of the referenced columns.public void clearCurrentRowInformation()
getCurrentCellsBuffer()
) and resets
the columns ID iterator used by nextCharID()
.public java.lang.String nextCharID()
char
tag) at the current position of the underlying iterator and stores it
in the property getCurrentExpectedCharID()
.
If this method is called the first time after creation of this object or after a call of clearCurrentRowInformation()
a new iterator will be created before returning an event.
char
tag or null
if no additional columns are availablepublic java.lang.String getCurrentExpectedCharID()
nextCharID()
.null
if no more IDs are to comepublic boolean isCurrentCellBuffered()
cell
tag are buffered or not. Buffering becomes necessary, if the order
of cell
tags differs from the order of column definitions from char
tags.true
if the current cell is buffered or false
otherwisepublic void setCurrentCellBuffered(boolean currentCellBuffered)
cell
tag are buffered or not.