tom | e348941 | 2014-08-29 02:30:38 -0700 | [diff] [blame] | 1 | package org.onlab.graph; |
| 2 | |
| 3 | /** |
| 4 | * Abstraction of a mutable graph that can be constructed gradually. |
| 5 | */ |
| 6 | public 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 | } |