Interface Node

    • Method Detail

      • add

        void add​(Edge e)
        Adds an edge to the adjacency list of the node.
        Parameters:
        e - Adjacent edge to add.
      • remove

        void remove​(Edge e)
        Removes an edge from the adjacency list of the node.
        Parameters:
        e - Adjacent edge to remove.
      • getEdge

        Edge getEdge​(Node other)
        Returns an edge in the adjacency list of the node that is adjacent to another specified node.

        Note: It is possible for two nodes to share multiple edges between them. In this case, getEdges(Node other) can be used to obtain a complete list.
        Parameters:
        other - The other node that the desired edge to return is adjacent to.
        Returns:
        The first edge that is found to be adjacent to the specified node.
      • getEdges

        List<? extends Edge> getEdges​(Node other)
        Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node.
        Parameters:
        other - The other node that the desired edges to return are adjacent to.
        Returns:
        List of all edges that are found to be adjacent to the specified node.
      • getEdges

        List<? extends Edge> getEdges()
        Returns the edge adjacency list of the node.
        Returns:
        A list containing all edges that are adjacent to the node.
      • getDegree

        int getDegree()
        Returns the degree of the node. The degree of a node is defined as the number of edges that are adjacent to the node.
        Returns:
        int Degree of node.