Package org.onlab.graph
Class MutableAdjacencyListsGraph<V extends Vertex,E extends Edge<V>>
- java.lang.Object
-
- org.onlab.graph.MutableAdjacencyListsGraph<V,E>
-
- All Implemented Interfaces:
Graph<V,E>,MutableGraph<V,E>
public class MutableAdjacencyListsGraph<V extends Vertex,E extends Edge<V>> extends Object implements MutableGraph<V,E>
-
-
Constructor Summary
Constructors Constructor Description MutableAdjacencyListsGraph(Set<V> vertex, Set<E> edge)Creates a graph comprising of the specified vertexes and edges.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(E edge)Adds the specified edge to this graph.voidaddVertex(V vertex)Adds the specified vertex to this graph.voidclear()Clear the graph.booleanequals(Object obj)Set<E>getEdges()Returns the set of edges comprising the graph.Set<E>getEdgesFrom(V src)Returns all edges leading out from the specified source vertex.Set<E>getEdgesTo(V dst)Returns all edges leading towards the specified destination vertex.Set<V>getVertexes()Returns the set of vertexes comprising the graph.inthashCode()voidremoveEdge(E edge)Removes the specified edge from the graph.voidremoveVertex(V vertex)Removes the specified vertex from the graph.Graph<V,E>toImmutable()Returns an immutable copy of this graph.StringtoString()
-
-
-
Method Detail
-
getVertexes
public Set<V> getVertexes()
Description copied from interface:GraphReturns the set of vertexes comprising the graph.
-
getEdges
public Set<E> getEdges()
Description copied from interface:GraphReturns the set of edges comprising the graph.
-
getEdgesFrom
public Set<E> getEdgesFrom(V src)
Description copied from interface:GraphReturns all edges leading out from the specified source vertex.
-
getEdgesTo
public Set<E> getEdgesTo(V dst)
Description copied from interface:GraphReturns all edges leading towards the specified destination vertex.
-
addVertex
public void addVertex(V vertex)
Description copied from interface:MutableGraphAdds the specified vertex to this graph.
-
removeVertex
public void removeVertex(V vertex)
Description copied from interface:MutableGraphRemoves the specified vertex from the graph.- Specified by:
removeVertexin interfaceMutableGraph<V extends Vertex,E extends Edge<V>>- Parameters:
vertex- vertex to be removed
-
addEdge
public void addEdge(E edge)
Description copied from interface:MutableGraphAdds the specified edge to this graph. If the edge vertexes are not already in the graph, they will be added as well.
-
removeEdge
public void removeEdge(E edge)
Description copied from interface:MutableGraphRemoves the specified edge from the graph.- Specified by:
removeEdgein interfaceMutableGraph<V extends Vertex,E extends Edge<V>>- Parameters:
edge- edge to be removed
-
toImmutable
public Graph<V,E> toImmutable()
Description copied from interface:MutableGraphReturns an immutable copy of this graph.- Specified by:
toImmutablein interfaceMutableGraph<V extends Vertex,E extends Edge<V>>- Returns:
- immutable copy
-
clear
public void clear()
Clear the graph.
-
-