Package org.biojavax.bio.phylo.io.nexus
Class NexusBlockBuilder.Abstract
- java.lang.Object
-
- org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder.Abstract
-
- All Implemented Interfaces:
NexusBlockBuilder,NexusBlockListener
- Direct Known Subclasses:
CharactersBlockBuilder,DistancesBlockBuilder,TaxaBlockBuilder,TreesBlockBuilder
- Enclosing interface:
- NexusBlockBuilder
public abstract static class NexusBlockBuilder.Abstract extends Object implements NexusBlockBuilder
This abstract version knows how to build and add comments.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder
NexusBlockBuilder.Abstract
-
-
Constructor Summary
Constructors Constructor Description Abstract()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddComment(NexusComment comment)Tell the builder to add the given comment at the current location.voidbeginComment()Opening a comment tag.voidcommentText(String comment)Receiving free text inside a comment tag.voidendComment()Closing a comment tag.protected StringgetBlockName()Obtains the name of this block.NexusBlockgetNexusBlock()Obtain the constructed block.voidstartBlock(String blockName)Notifies the parser that a new block is starting.protected abstract NexusBlockstartBlockObject()Tell the builder to start a new block object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockListener
endBlock, endTokenGroup
-
-
-
-
Constructor Detail
-
Abstract
public Abstract()
-
-
Method Detail
-
getBlockName
protected String getBlockName()
Obtains the name of this block.
-
beginComment
public void beginComment()
Description copied from interface:NexusBlockListenerOpening a comment tag.- Specified by:
beginCommentin interfaceNexusBlockListener
-
commentText
public void commentText(String comment)
Description copied from interface:NexusBlockListenerReceiving free text inside a comment tag.- Specified by:
commentTextin interfaceNexusBlockListener- Parameters:
comment- the text of the comment.
-
endComment
public void endComment()
Description copied from interface:NexusBlockListenerClosing a comment tag.- Specified by:
endCommentin interfaceNexusBlockListener
-
addComment
protected abstract void addComment(NexusComment comment)
Tell the builder to add the given comment at the current location.- Parameters:
comment- the comment to add.- Throws:
ParseException- if the comment was invalid.
-
startBlock
public void startBlock(String blockName)
Description copied from interface:NexusBlockListenerNotifies the parser that a new block is starting.- Specified by:
startBlockin interfaceNexusBlockListener- Parameters:
blockName- the name of the newly started block.
-
startBlockObject
protected abstract NexusBlock startBlockObject()
Tell the builder to start a new block object.
-
getNexusBlock
public NexusBlock getNexusBlock()
Description copied from interface:NexusBlockBuilderObtain the constructed block.- Specified by:
getNexusBlockin interfaceNexusBlockBuilder- Returns:
- the constructed block.
-
-