jebl.evolution.trees
public abstract class FilteredRootedTree extends java.lang.Object implements RootedTree
Graph.NoEdgeException, Graph.Utils
Constructor and Description |
---|
FilteredRootedTree(RootedTree source) |
Modifier and Type | Method and Description |
---|---|
boolean |
conceptuallyUnrooted()
Due to current implementation limitations, trees store "branch" information in nodes.
|
java.util.List<Node> |
getAdjacencies(Node node)
Returns a list of nodes connected to this node by an edge
|
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributeMap()
Gets the entire attribute map.
|
java.util.Set<java.lang.String> |
getAttributeNames() |
java.util.List<Node> |
getChildren(Node node) |
Edge |
getEdge(Node node1,
Node node2)
Returns the Edge that connects these two nodes
|
double |
getEdgeLength(Node node1,
Node node2)
Returns the length of the edge that connects these two nodes
|
java.util.Set<Edge> |
getEdges() |
java.util.List<Edge> |
getEdges(Node node)
Returns a list of edges connected to this node
|
java.util.Set<Edge> |
getExternalEdges() |
java.util.Set<Node> |
getExternalNodes() |
double |
getHeight(Node node) |
java.util.Set<Edge> |
getInternalEdges() |
java.util.Set<Node> |
getInternalNodes() |
double |
getLength(Node node) |
Node |
getNode(Taxon taxon) |
java.util.Set<Node> |
getNodes() |
Node[] |
getNodes(Edge edge)
Returns an array of 2 nodes which are the nodes at either end of the edge.
|
java.util.Set<Node> |
getNodes(int degree) |
Node |
getParent(Node node) |
Node |
getRootNode()
The root of the tree has the largest node height of
all nodes in the tree.
|
RootedTree |
getSource() |
java.util.Set<Taxon> |
getTaxa() |
Taxon |
getTaxon(Node node) |
boolean |
hasHeights() |
boolean |
hasLengths() |
boolean |
isExternal(Node node) |
boolean |
isRoot(Node node) |
void |
removeAttribute(java.lang.String name) |
void |
renameTaxa(Taxon from,
Taxon to) |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an named attribute for this object.
|
public FilteredRootedTree(RootedTree source)
public RootedTree getSource()
public boolean conceptuallyUnrooted()
RootedTree
conceptuallyUnrooted
in interface RootedTree
public java.util.List<Node> getChildren(Node node)
getChildren
in interface RootedTree
node
- the node whose children are being requested.public boolean hasHeights()
hasHeights
in interface RootedTree
public double getHeight(Node node)
getHeight
in interface RootedTree
node
- the node whose height is being requested.public boolean hasLengths()
hasLengths
in interface RootedTree
public double getLength(Node node)
getLength
in interface RootedTree
node
- the node whose branch length (to its parent) is being requested.public Node getParent(Node node)
getParent
in interface RootedTree
node
- the node whose parent is requestedpublic Node getRootNode()
RootedTree
getRootNode
in interface RootedTree
public java.util.Set<Node> getExternalNodes()
getExternalNodes
in interface Tree
public java.util.Set<Node> getInternalNodes()
getInternalNodes
in interface Tree
public java.util.Set<Edge> getExternalEdges()
getExternalEdges
in interface Tree
public java.util.Set<Edge> getInternalEdges()
getInternalEdges
in interface Tree
public java.util.Set<Taxon> getTaxa()
public boolean isExternal(Node node)
isExternal
in interface Tree
node
- the nodepublic java.util.List<Node> getAdjacencies(Node node)
Graph
getAdjacencies
in interface Graph
public java.util.List<Edge> getEdges(Node node)
Graph
public java.util.Set<Edge> getEdges()
public Node[] getNodes(Edge edge)
Graph
public Edge getEdge(Node node1, Node node2) throws Graph.NoEdgeException
Graph
getEdge
in interface Graph
Graph.NoEdgeException
- if the nodes are not directly connected by an edge.public double getEdgeLength(Node node1, Node node2) throws Graph.NoEdgeException
Graph
getEdgeLength
in interface Graph
Graph.NoEdgeException
- if the nodes are not directly connected by an edge.public java.util.Set<Node> getNodes()
public java.util.Set<Node> getNodes(int degree)
public boolean isRoot(Node node)
isRoot
in interface RootedTree
node
- the nodepublic void renameTaxa(Taxon from, Taxon to)
renameTaxa
in interface Tree
public void setAttribute(java.lang.String name, java.lang.Object value)
Attributable
setAttribute
in interface Attributable
name
- the name of the attribute.value
- the new value of the attribute.public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface Attributable
name
- the name of the attribute of interest, or null if the attribute doesn't exist.public void removeAttribute(java.lang.String name)
removeAttribute
in interface Attributable
name
- name of attribute to removepublic java.util.Set<java.lang.String> getAttributeNames()
getAttributeNames
in interface Attributable
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
Attributable
getAttributeMap
in interface Attributable
http://code.google.com/p/jebl2/