Package org.onlab.graph
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addEdge(E edge)
Adds the specified edge to this graph.void
addVertex(V vertex)
Adds the specified vertex to this graph.void
removeEdge(E edge)
Removes the specified edge from the graph.void
removeVertex(V vertex)
Removes the specified vertex from the graph.Graph<V,E>
toImmutable()
Returns an immutable copy of this graph.-
Methods inherited from interface org.onlab.graph.Graph
getEdges, getEdgesFrom, getEdgesTo, getVertexes
-
-
-
-
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
-
-