Package jebl.evolution.graphs
Interface Graph
- All Superinterfaces:
Attributable
- All Known Subinterfaces:
RootedTree
,Tree
- All Known Implementing Classes:
AbstractRootedTree
,CompactRootedTree
,FilteredRootedTree
,MutableRootedTree
,ReRootedTree
,RootedFromUnrooted
,RootedSubtree
,SimpleRootedTree
,SimpleTree
,SortedRootedTree
,TransformedRootedTree
- Version:
- $Id: Graph.java 849 2007-12-06 00:10:14Z twobeers $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
This class is thrown by getEdgeLength(node1, node2) if node1 and node2 are not directly connected by an edge.static class
-
Method Summary
Modifier and TypeMethodDescriptiongetAdjacencies
(Node node) Returns a list of nodes connected to this node by an edgeReturns the Edge that connects these two nodesdouble
getEdgeLength
(Node node1, Node node2) Returns the length of the edge that connects these two nodesgetEdges()
Returns a list of edges connected to this nodegetNodes()
getNodes
(int degree) Node[]
Returns an array of 2 nodes which are the nodes at either end of the edge.Methods inherited from interface jebl.util.Attributable
getAttribute, getAttributeMap, getAttributeNames, removeAttribute, setAttribute
-
Method Details
-
getEdges
Returns a list of edges connected to this node- Parameters:
node
-- Returns:
- the set of nodes that are attached by edges to the given node.
-
getAdjacencies
Returns a list of nodes connected to this node by an edge- Parameters:
node
-- Returns:
- the set of nodes that are attached by edges to the given node.
-
getEdge
Returns the Edge that connects these two nodes- Parameters:
node1
-node2
-- Returns:
- the edge object.
- Throws:
Graph.NoEdgeException
- if the nodes are not directly connected by an edge.
-
getEdgeLength
Returns the length of the edge that connects these two nodes- Parameters:
node1
-node2
-- Returns:
- the edge length.
- Throws:
Graph.NoEdgeException
- if the nodes are not directly connected by an edge.
-
getNodes
Returns an array of 2 nodes which are the nodes at either end of the edge.- Parameters:
edge
-- Returns:
- an array of 2 edges
-
getNodes
- Returns:
- the set of all nodes in this graph.
-
getEdges
- Returns:
- the set of all edges in this graph.
-
getNodes
- Parameters:
degree
- the number of edges connected to a node- Returns:
- a set containing all nodes in this graph of the given degree.
-