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 void
addComment(NexusComment comment)
Tell the builder to add the given comment at the current location.void
beginComment()
Opening a comment tag.void
commentText(String comment)
Receiving free text inside a comment tag.void
endComment()
Closing a comment tag.protected String
getBlockName()
Obtains the name of this block.NexusBlock
getNexusBlock()
Obtain the constructed block.void
startBlock(String blockName)
Notifies the parser that a new block is starting.protected abstract NexusBlock
startBlockObject()
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:NexusBlockListener
Opening a comment tag.- Specified by:
beginComment
in interfaceNexusBlockListener
-
commentText
public void commentText(String comment)
Description copied from interface:NexusBlockListener
Receiving free text inside a comment tag.- Specified by:
commentText
in interfaceNexusBlockListener
- Parameters:
comment
- the text of the comment.
-
endComment
public void endComment()
Description copied from interface:NexusBlockListener
Closing a comment tag.- Specified by:
endComment
in 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:NexusBlockListener
Notifies the parser that a new block is starting.- Specified by:
startBlock
in 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:NexusBlockBuilder
Obtain the constructed block.- Specified by:
getNexusBlock
in interfaceNexusBlockBuilder
- Returns:
- the constructed block.
-
-