## org.biojavax.bio.phylo.io.nexus
Class TreesBlock

    java.lang.Object
      org.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
          org.biojavax.bio.phylo.io.nexus.TreesBlock

All Implemented Interfaces:
  NexusBlock, NexusObject

    public class TreesBlock

extends NexusBlock.Abstract

Represents Nexus trees blocks.

Since:
  1.6
Author:
  Richard Holland, Tobias Thierer, Jim Balhoff

Nested Class Summary
`static class` `TreesBlock.NewickTreeString` A simple representation of a Newick tree as a single string.

Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlock
`NexusBlock.Abstract`

Field Summary
`static java.lang.String` `TREES_BLOCK` A constant representing the name of Trees blocks.

Constructor Summary
`TreesBlock()` Delegates to NexusBlock.Abstract constructor using TreesBlock.TREES_BLOCK as the name.

Method Summary
`void` `addComment(NexusComment comment)` Adds a comment.
`void` `addTranslation(java.lang.String label, java.lang.String taxa)` Add a translation.
`void` `addTree(java.lang.String label, TreesBlock.NewickTreeString tree)` Adds a tree.
`boolean` `containsTranslation(java.lang.String label)` Checks to see if we contain the given translation.
`boolean` `containsTree(java.lang.String label)` Checks to see if we contain the given tree.
`java.util.List` `getComments()` Returns all comments.
`java.util.Map` `getTranslations()` Get the translations added so far.
`java.util.Map` `getTrees()` Returns all trees.
`void` `removeComment(NexusComment comment)` Removes a comment.
`void` `removeTranslation(java.lang.String label)` Removes the given translation.
`void` `removeTree(java.lang.String label)` Removes a tree.
`protected void` `writeBlockContents(java.io.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`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TREES_BLOCK

    public static final java.lang.String TREES_BLOCK

  A constant representing the name of Trees blocks.

  See Also:
    Constant Field Values

Constructor Detail

### TreesBlock

    public TreesBlock()

  Delegates to NexusBlock.Abstract constructor using TreesBlock.TREES_BLOCK as the name.

Method Detail

### addTranslation

    public void addTranslation(java.lang.String label,
                               java.lang.String taxa)

  Add a translation.

  Parameters:
    `label` - the label to add.
    `taxa` - the taxa name this label will represent.

### removeTranslation

    public void removeTranslation(java.lang.String label)

  Removes the given translation.

  Parameters:
    `label` - the label to remove.

### containsTranslation

    public boolean containsTranslation(java.lang.String label)

  Checks to see if we contain the given translation.

  Parameters:
    `label` - the label to check for.
  Returns:
    `true` if we already contain it.

### getTranslations

    public java.util.Map getTranslations()

  Get the translations added so far.

  Returns:
    the translations added so far.

### addTree

    public void addTree(java.lang.String label,
                        TreesBlock.NewickTreeString tree)

  Adds a tree.

  Parameters:
    `label` - the label to give the tree.
    `tree` - the tree to add.

### removeTree

    public void removeTree(java.lang.String label)

  Removes a tree.

  Parameters:
    `label` - the label to remove.

### containsTree

    public boolean containsTree(java.lang.String label)

  Checks to see if we contain the given tree.

  Parameters:
    `label` - the label to check for.
  Returns:
    `true` if we already contain it.

### getTrees

    public java.util.Map getTrees()

  Returns all trees.

  Returns:
    all the selected trees.

### addComment

    public void addComment(NexusComment comment)

  Adds a comment.

  Parameters:
    `comment` - the comment to add.

### removeComment

    public void removeComment(NexusComment comment)

  Removes a comment.

  Parameters:
    `comment` - the comment to remove.

### getComments

    public java.util.List getComments()

  Returns all comments.

  Returns:
    all the selected comments.

### writeBlockContents

    protected void writeBlockContents(java.io.Writer writer)
                               throws java.io.IOException

  Description copied from class: `NexusBlock.Abstract`
  Implement this to write out block contents, not including the BEGIN and END tags.

  Specified by:
    `writeBlockContents` in class `NexusBlock.Abstract`
  Parameters:
    `writer` - the writer to write to.
  Throws:
    `java.io.IOException` - if writing failed.