Package org.biojavax.bio.phylo.io.nexus
Class NexusBlockParser.Abstract
java.lang.Object
org.biojavax.bio.phylo.io.nexus.NexusBlockParser.Abstract
- All Implemented Interfaces:
NexusBlockParser
- Direct Known Subclasses:
CharactersBlockParser,DistancesBlockParser,TaxaBlockParser,TreesBlockParser
- Enclosing interface:
- NexusBlockParser
All block parsers should derive from this abstract parser.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockParser
NexusBlockParser.Abstract -
Field Summary
Fields inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockParser
UNKNOWN_BLOCK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidOpening a comment tag.voidcommentText(String comment) Receiving free text inside a comment tag.voidendBlock()Notifies the parser that a block is ending.voidClosing a comment tag.voidClosing a line (semi-colon encountered).Obtain the listener for this parser.protected Stringabstract voidparseToken(String token) Notifies the parser of the next token.protected abstract voidThis function is called when the parser is reset before starting a new block.voidstartBlock(String blockName) Notifies the parser that a new block is starting.booleanDoes the listener want to know about brackets and braces as separate tokens?
-
Constructor Details
-
Abstract
-
-
Method Details
-
getBlockListener
Description copied from interface:NexusBlockParserObtain the listener for this parser.- Specified by:
getBlockListenerin interfaceNexusBlockParser- Returns:
- the listener.
-
startBlock
Description copied from interface:NexusBlockParserNotifies the parser that a new block is starting.- Specified by:
startBlockin interfaceNexusBlockParser- Parameters:
blockName- the name of the block.
-
resetStatus
This function is called when the parser is reset before starting a new block. -
getBlockName
-
endBlock
Description copied from interface:NexusBlockParserNotifies the parser that a block is ending.- Specified by:
endBlockin interfaceNexusBlockParser
-
beginComment
Description copied from interface:NexusBlockParserOpening a comment tag.- Specified by:
beginCommentin interfaceNexusBlockParser
-
endComment
Description copied from interface:NexusBlockParserClosing a comment tag.- Specified by:
endCommentin interfaceNexusBlockParser
-
endTokenGroup
Description copied from interface:NexusBlockParserClosing a line (semi-colon encountered). This indicates that anything received after it is on the next logical line of the block.- Specified by:
endTokenGroupin interfaceNexusBlockParser
-
commentText
Description copied from interface:NexusBlockParserReceiving free text inside a comment tag.- Specified by:
commentTextin interfaceNexusBlockParser- Parameters:
comment- the text of the comment.- Throws:
ParseException
-
parseToken
Description copied from interface:NexusBlockParserNotifies the parser of the next token. Comment tokens will already have been parsed out and sent separately to the text() method of the listener. Quoted strings will have been parsed and underscores converted. What this token contains is the full string, after removal of quotes if necessary. The token will never be only whitespace.- Specified by:
parseTokenin interfaceNexusBlockParser- Parameters:
token- the token to parse.- Throws:
ParseException- if the token is unparseable.
-
wantsBracketsAndBraces
Description copied from interface:NexusBlockParserDoes the listener want to know about brackets and braces as separate tokens?- Specified by:
wantsBracketsAndBracesin interfaceNexusBlockParser- Returns:
- true if it does.
-