|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
org.biojavax.bio.phylo.io.nexus.TreesBlock
public class TreesBlock
Represents Nexus trees blocks.
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 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(String label,
String taxa)
Add a translation. |
void |
addTree(String label,
TreesBlock.NewickTreeString tree)
Adds a tree. |
void |
addTree(String label,
org.jgrapht.UndirectedGraph<String,org.jgrapht.graph.DefaultEdge> treegraph)
Add a tree, converting unweighted graph (JGraphT) to NewickString |
void |
addTree(String label,
org.jgrapht.WeightedGraph<String,org.jgrapht.graph.DefaultWeightedEdge> treegraph)
Add a tree, converting weighted graph (JGraphT) to NewickString |
boolean |
containsTranslation(String label)
Checks to see if we contain the given translation. |
boolean |
containsTree(String label)
Checks to see if we contain the given tree. |
List |
getComments()
Returns all comments. |
Map |
getTranslations()
Get the translations added so far. |
Object |
getTree(String label)
Returns a tree for given label |
org.jgrapht.UndirectedGraph<String,org.jgrapht.graph.DefaultEdge> |
getTreeAsJGraphT(String label)
Get given (NewieckString) tree by label, converts it to unweighted graph (JGraphT). |
org.jgrapht.WeightedGraph<String,org.jgrapht.graph.DefaultWeightedEdge> |
getTreeAsWeightedJGraphT(String label)
Get given (NewieckString) tree by label, converts it to weighted graph (JGraphT). |
Map |
getTrees()
Returns all trees. |
void |
removeComment(NexusComment comment)
Removes a comment. |
void |
removeTranslation(String label)
Removes the given translation. |
void |
removeTree(String label)
Removes a tree. |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TREES_BLOCK
Constructor Detail |
---|
public TreesBlock()
Method Detail |
---|
public void addTranslation(String label, String taxa)
label
- the label to add.taxa
- the taxa name this label will represent.public void removeTranslation(String label)
label
- the label to remove.public boolean containsTranslation(String label)
label
- the label to check for.
public Map getTranslations()
public void addTree(String label, TreesBlock.NewickTreeString tree)
label
- the label to give the tree.tree
- the tree to add.public void removeTree(String label)
label
- the label to remove.public boolean containsTree(String label)
label
- the label to check for.
public Map getTrees()
public Object getTree(String label)
label
- the label to select.
public void addTree(String label, org.jgrapht.UndirectedGraph<String,org.jgrapht.graph.DefaultEdge> treegraph)
label
- the label to addtreegraph
- the treegraph to convert.public void addTree(String label, org.jgrapht.WeightedGraph<String,org.jgrapht.graph.DefaultWeightedEdge> treegraph)
label
- the label to addtreegraph
- the treegraph to convert.public org.jgrapht.UndirectedGraph<String,org.jgrapht.graph.DefaultEdge> getTreeAsJGraphT(String label)
label
- label for tree selection
public org.jgrapht.WeightedGraph<String,org.jgrapht.graph.DefaultWeightedEdge> getTreeAsWeightedJGraphT(String label)
label
- label for tree selection
public void addComment(NexusComment comment)
comment
- the comment to add.public void removeComment(NexusComment comment)
comment
- the comment to remove.public List getComments()
protected void writeBlockContents(Writer writer) throws IOException
NexusBlock.Abstract
writeBlockContents
in class NexusBlock.Abstract
writer
- the writer to write to.
IOException
- if writing failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |