Interface MutableValueGraph<N,​V>

    • Method Detail

      • addNode

        boolean addNode​(N node)
        Adds node if it is not already present.

        Nodes must be unique, just as Map keys must be. They must also be non-null.

        Returns:
        true if the graph was modified as a result of this call
      • putEdgeValue

        V putEdgeValue​(N nodeU,
                       N nodeV,
                       V value)
        Adds an edge connecting nodeU to nodeV if one is not already present; associate that edge with value. In an undirected graph, the edge will also connect nodeV to nodeU.

        Values do not have to be unique. However, values must be non-null.

        If nodeU and nodeV are not already present in this graph, this method will silently add nodeU and nodeV to the graph.

        Returns:
        the value previously associated with the edge connecting nodeU to nodeV, or null if there was no such edge.
        Throws:
        java.lang.IllegalArgumentException - if the introduction of the edge would violate ValueGraph.allowsSelfLoops()
      • removeNode

        boolean removeNode​(N node)
        Removes node if it is present; all edges incident to node will also be removed.
        Returns:
        true if the graph was modified as a result of this call
      • removeEdge

        V removeEdge​(N nodeU,
                     N nodeV)
        Removes the edge connecting nodeU to nodeV, if it is present.
        Returns:
        the value previously associated with the edge connecting nodeU to nodeV, or null if there was no such edge.