Package org.biojavax.bio.phylo.io.nexus
Class DistancesBlock
java.lang.Object
org.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
org.biojavax.bio.phylo.io.nexus.DistancesBlock
- All Implemented Interfaces:
NexusBlock
,NexusObject
Represents 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.NexusBlock
NexusBlock.Abstract
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
A constant representing the name of Distances blocks. -
Constructor Summary
ConstructorsConstructorDescriptionDelegates to NexusBlock.Abstract constructor using DistancesBlock.DISTANCES_BLOCK as the name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComment
(NexusComment comment) Adds a comment.void
addMatrixEntry
(String taxa) void
addTaxLabel
(String taxLabel) Add a TAXLABEL.void
appendMatrixData
(String taxa, Object data) boolean
containsTaxLabel
(String taxLabel) Checks to see if we contain the given TAXLABEL.Returns all comments.int
Get the NCHAR value.int
Get the NTAX value.getMatrixData
(String taxa) Get the TAXLABEL values added so far.boolean
boolean
boolean
isLabels()
void
removeComment
(NexusComment comment) Removes a comment.void
removeTaxLabel
(String taxLabel) Removes the given TAXLABEL.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 void
writeBlockContents
(Writer writer) Implement this to write out block contents, not including the BEGIN and END tags.Methods inherited from class org.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
getBlockName, writeObject, writeToken
-
Field Details
-
DISTANCES_BLOCK
A constant representing the name of Distances blocks.- See Also:
-
-
Constructor Details
-
DistancesBlock
public DistancesBlock()Delegates to NexusBlock.Abstract constructor using DistancesBlock.DISTANCES_BLOCK as the name.
-
-
Method Details
-
setDimensionsNTax
Set the NTAX value.- Parameters:
dimensionsNTax
- the NTAX value.
-
getDimensionsNTax
Get the NTAX value.- Returns:
- the NTAX value.
-
setDimensionsNChar
Set the NCHAR value.- Parameters:
dimensionsNChar
- the NCHAR value.
-
getDimensionsNChar
Get the NCHAR value.- Returns:
- the NCHAR value.
-
setTriangle
-
setDiagonal
-
isDiagonal
-
setLabels
-
isLabels
-
setMissing
-
getMissing
-
setInterleaved
-
isInterleaved
-
addTaxLabel
Add a TAXLABEL. If it already exists, or is a number that refers to an index position that already exists, an exception is thrown.- Parameters:
taxLabel
- the label to add.- Throws:
ParseException
- if the label cannot be added.
-
removeTaxLabel
Removes the given TAXLABEL.- Parameters:
taxLabel
- the label to remove.
-
containsTaxLabel
Checks to see if we contain the given TAXLABEL.- Parameters:
taxLabel
- the label to check for.- Returns:
- true if we already contain it.
-
getTaxLabels
Get the TAXLABEL values added so far.- Returns:
- this labels so far.
-
addMatrixEntry
-
appendMatrixData
-
getMatrixData
-
getMatrixLabels
-
addComment
Adds a comment.- Parameters:
comment
- the comment to add.
-
removeComment
Removes a comment.- Parameters:
comment
- the comment to remove.
-
getComments
Returns all comments.- Returns:
- all the selected comments.
-
writeBlockContents
Description copied from class:NexusBlock.Abstract
Implement this to write out block contents, not including the BEGIN and END tags.- Specified by:
writeBlockContents
in classNexusBlock.Abstract
- Parameters:
writer
- the writer to write to.- Throws:
IOException
- if writing failed.
-