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

public interface Graph extends Attributable
Version:
$Id: Graph.java 849 2007-12-06 00:10:14Z twobeers $
Author:
Andrew Rambaut, Alexei Drummond
  • Method Details

    • getEdges

      List<Edge> getEdges(Node node)
      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

      List<Node> getAdjacencies(Node node)
      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

      Edge getEdge(Node node1, Node node2) throws Graph.NoEdgeException
      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

      double getEdgeLength(Node node1, Node node2) throws Graph.NoEdgeException
      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

      Node[] getNodes(Edge edge)
      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

      Set<Node> getNodes()
      Returns:
      the set of all nodes in this graph.
    • getEdges

      Set<Edge> getEdges()
      Returns:
      the set of all edges in this graph.
    • getNodes

      Set<Node> getNodes(int degree)
      Parameters:
      degree - the number of edges connected to a node
      Returns:
      a set containing all nodes in this graph of the given degree.