Package org.biojavax.bio.phylo.io.nexus
Class NexusBlock.Abstract
- java.lang.Object
-
- org.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
-
- All Implemented Interfaces:
NexusBlock
,NexusObject
- Direct Known Subclasses:
CharactersBlock
,DistancesBlock
,TaxaBlock
,TreesBlock
- Enclosing interface:
- NexusBlock
public abstract static class NexusBlock.Abstract extends java.lang.Object implements NexusBlock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlock
NexusBlock.Abstract
-
-
Constructor Summary
Constructors Constructor Description Abstract(java.lang.String blockName)
Construct a block with a given name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBlockName()
Get the block name.protected abstract void
writeBlockContents(java.io.Writer writer)
Implement this to write out block contents, not including the BEGIN and END tags.void
writeObject(java.io.Writer writer)
Writes this object to the given writer.protected void
writeToken(java.io.Writer writer, java.lang.String token)
Writes a token and correctly substitutes all symbols in it.
-
-
-
Constructor Detail
-
Abstract
public Abstract(java.lang.String blockName)
Construct a block with a given name.- Parameters:
blockName
- the name to give the block.
-
-
Method Detail
-
getBlockName
public java.lang.String getBlockName()
Description copied from interface:NexusBlock
Get the block name.- Specified by:
getBlockName
in interfaceNexusBlock
- Returns:
- the block name.
-
writeObject
public void writeObject(java.io.Writer writer) throws java.io.IOException
Description copied from interface:NexusObject
Writes this object to the given writer.- Specified by:
writeObject
in interfaceNexusObject
- Parameters:
writer
- the writer to write to.- Throws:
java.io.IOException
- if it could not be written.
-
writeToken
protected void writeToken(java.io.Writer writer, java.lang.String token) throws java.io.IOException
Writes a token and correctly substitutes all symbols in it.- Parameters:
writer
- the writer to write to.token
- the token to write.- Throws:
java.io.IOException
- if writing failed.
-
writeBlockContents
protected abstract void writeBlockContents(java.io.Writer writer) throws java.io.IOException
Implement this to write out block contents, not including the BEGIN and END tags.- Parameters:
writer
- the writer to write to.- Throws:
java.io.IOException
- if writing failed.
-
-