public class MutableAdjacencyListsGraph<V extends Vertex,E extends Edge<V>> extends java.lang.Object implements MutableGraph<V,E>
| Constructor and Description |
|---|
MutableAdjacencyListsGraph(java.util.Set<V> vertex,
java.util.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(java.lang.Object obj) |
java.util.Set<E> |
getEdges()
Returns the set of edges comprising the graph.
|
java.util.Set<E> |
getEdgesFrom(V src)
Returns all edges leading out from the specified source vertex.
|
java.util.Set<E> |
getEdgesTo(V dst)
Returns all edges leading towards the specified destination vertex.
|
java.util.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.
|
java.lang.String |
toString() |
public java.util.Set<V> getVertexes()
Graphpublic java.util.Set<E> getEdges()
Graphpublic java.util.Set<E> getEdgesFrom(V src)
Graphpublic java.util.Set<E> getEdgesTo(V dst)
Graphpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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()