Package org.biojavax.bio.phylo.io.nexus
Class DistancesBlockBuilder
- java.lang.Object
-
- org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder.Abstract
-
- org.biojavax.bio.phylo.io.nexus.DistancesBlockBuilder
-
- All Implemented Interfaces:
DistancesBlockListener
,NexusBlockBuilder
,NexusBlockListener
public class DistancesBlockBuilder extends NexusBlockBuilder.Abstract implements DistancesBlockListener
Builds Nexus distances blocks.- Since:
- 1.6
- Author:
- Richard Holland, Tobias Thierer, Jim Balhoff
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder
NexusBlockBuilder.Abstract
-
-
Constructor Summary
Constructors Constructor Description DistancesBlockBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addComment(NexusComment comment)
Tell the builder to add the given comment at the current location.void
addMatrixEntry(String taxa)
void
addTaxLabel(String taxLabel)
Add a TAXLABEL.void
appendMatrixData(String taxa, Object data)
void
endBlock()
Notifies the parser that a block is ending.void
endTokenGroup()
Closing a line (semi-colon encountered).void
setDiagonal(boolean diagonal)
void
setDimensionsNChar(int dimensionsNChar)
Set the NCHAR value.void
setDimensionsNTax(int dimensionsNTax)
Set the NTAX value.void
setInterleaved(boolean interleaved)
void
setLabels(boolean labels)
void
setMissing(String missing)
void
setTriangle(String triangle)
protected NexusBlock
startBlockObject()
Tell the builder to start a new block object.-
Methods inherited from class org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder.Abstract
beginComment, commentText, endComment, getBlockName, getNexusBlock, startBlock
-
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
beginComment, commentText, endComment, startBlock
-
-
-
-
Constructor Detail
-
DistancesBlockBuilder
public DistancesBlockBuilder()
-
-
Method Detail
-
addComment
protected void addComment(NexusComment comment)
Description copied from class:NexusBlockBuilder.Abstract
Tell the builder to add the given comment at the current location.- Specified by:
addComment
in classNexusBlockBuilder.Abstract
- Parameters:
comment
- the comment to add.
-
startBlockObject
protected NexusBlock startBlockObject()
Description copied from class:NexusBlockBuilder.Abstract
Tell the builder to start a new block object.- Specified by:
startBlockObject
in classNexusBlockBuilder.Abstract
-
endBlock
public void endBlock()
Description copied from interface:NexusBlockListener
Notifies the parser that a block is ending.- Specified by:
endBlock
in interfaceNexusBlockListener
-
endTokenGroup
public void endTokenGroup()
Description copied from interface:NexusBlockListener
Closing a line (semi-colon encountered). This indicates that anything received after it is on the next logical line of the block.- Specified by:
endTokenGroup
in interfaceNexusBlockListener
-
addMatrixEntry
public void addMatrixEntry(String taxa)
- Specified by:
addMatrixEntry
in interfaceDistancesBlockListener
-
addTaxLabel
public void addTaxLabel(String taxLabel) throws ParseException
Description copied from interface:DistancesBlockListener
Add a TAXLABEL. If it already exists, or is a number that refers to an index position that already exists, an exception is thrown.- Specified by:
addTaxLabel
in interfaceDistancesBlockListener
- Parameters:
taxLabel
- the label to add.- Throws:
ParseException
- if the label cannot be added.
-
appendMatrixData
public void appendMatrixData(String taxa, Object data)
- Specified by:
appendMatrixData
in interfaceDistancesBlockListener
-
setDimensionsNChar
public void setDimensionsNChar(int dimensionsNChar)
Description copied from interface:DistancesBlockListener
Set the NCHAR value.- Specified by:
setDimensionsNChar
in interfaceDistancesBlockListener
- Parameters:
dimensionsNChar
- the NCHAR value.
-
setDimensionsNTax
public void setDimensionsNTax(int dimensionsNTax)
Description copied from interface:DistancesBlockListener
Set the NTAX value.- Specified by:
setDimensionsNTax
in interfaceDistancesBlockListener
- Parameters:
dimensionsNTax
- the NTAX value.
-
setInterleaved
public void setInterleaved(boolean interleaved)
- Specified by:
setInterleaved
in interfaceDistancesBlockListener
-
setLabels
public void setLabels(boolean labels)
- Specified by:
setLabels
in interfaceDistancesBlockListener
-
setMissing
public void setMissing(String missing)
- Specified by:
setMissing
in interfaceDistancesBlockListener
-
setDiagonal
public void setDiagonal(boolean diagonal)
- Specified by:
setDiagonal
in interfaceDistancesBlockListener
-
setTriangle
public void setTriangle(String triangle)
- Specified by:
setTriangle
in interfaceDistancesBlockListener
-
-