blob: 2974a884b6efa7f8dded0b12ac719a85533ab4d2 [file] [log] [blame]
tome3489412014-08-29 02:30:38 -07001package org.onlab.graph;
2
3/**
4 * Abstraction of a mutable graph that can be constructed gradually.
5 */
6public interface MutableGraph<V extends Vertex, E extends Edge> extends Graph<V, E> {
7
8 /**
9 * Adds the specified vertex to this graph.
10 *
11 * @param vertex new vertex
12 */
13 void addVertex(V vertex);
14
15 /**
16 * Removes the specified vertex from the graph.
17 *
18 * @param vertex vertex to be removed
19 */
20 void removeVertex(V vertex);
21
22 /**
23 * Adds the specified edge to this graph. If the edge vertexes are not
24 * already in the graph, they will be added as well.
25 *
26 * @param edge new edge
27 */
28 void addEdge(E edge);
29
30 /**
31 * Removes the specified edge from the graph.
32 *
33 * @param edge edge to be removed
34 */
35 void removeEdge(E edge);
36
37 /**
38 * Returns an immutable copy of this graph.
39 *
40 * @return immutable copy
41 */
42 Graph<V, E> toImmutable();
43
44}