public class MutableAdjacencyListsGraph<V extends Vertex,E extends Edge<V>> extends Object implements MutableGraph<V,E>
| Constructor and Description |
|---|
MutableAdjacencyListsGraph(Set<V> vertex,
Set<E> edge)
Creates a graph comprising of the specified vertexes and edges.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(E edge)
Adds the specified edge to this graph.
|
void |
addVertex(V vertex)
Adds the specified vertex to this graph.
|
void |
clear()
Clear the graph.
|
boolean |
equals(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.
|
int |
hashCode() |
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.
|
String |
toString() |
public Set<V> getVertexes()
Graphpublic Set<E> getEdges()
Graphpublic Set<E> getEdgesFrom(V src)
Graphpublic Set<E> getEdgesTo(V dst)
Graphpublic void addVertex(V vertex)
MutableGraphpublic void removeVertex(V vertex)
MutableGraphremoveVertex in interface MutableGraph<V extends Vertex,E extends Edge<V>>vertex - vertex to be removedpublic void addEdge(E edge)
MutableGraphpublic void removeEdge(E edge)
MutableGraphremoveEdge in interface MutableGraph<V extends Vertex,E extends Edge<V>>edge - edge to be removedpublic Graph<V,E> toImmutable()
MutableGraphtoImmutable in interface MutableGraph<V extends Vertex,E extends Edge<V>>public void clear()