Interface MutableGraph<V extends Vertex,​E extends Edge>

  • All Superinterfaces:
    Graph<V,​E>
    All Known Implementing Classes:
    MutableAdjacencyListsGraph

    public interface MutableGraph<V extends Vertex,​E extends Edge>
    extends Graph<V,​E>
    Abstraction of a mutable graph that can be constructed gradually.
    • Method Detail

      • addVertex

        void addVertex​(V vertex)
        Adds the specified vertex to this graph.
        Parameters:
        vertex - new vertex
      • removeVertex

        void removeVertex​(V vertex)
        Removes the specified vertex from the graph.
        Parameters:
        vertex - vertex to be removed
      • addEdge

        void addEdge​(E edge)
        Adds the specified edge to this graph. If the edge vertexes are not already in the graph, they will be added as well.
        Parameters:
        edge - new edge
      • removeEdge

        void removeEdge​(E edge)
        Removes the specified edge from the graph.
        Parameters:
        edge - edge to be removed
      • toImmutable

        Graph<V,​E> toImmutable()
        Returns an immutable copy of this graph.
        Returns:
        immutable copy