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()
Graph
public java.util.Set<E> getEdges()
Graph
public java.util.Set<E> getEdgesFrom(V src)
Graph
public java.util.Set<E> getEdgesTo(V dst)
Graph
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void addVertex(V vertex)
MutableGraph
public void removeVertex(V vertex)
MutableGraph
removeVertex
in interface MutableGraph<V extends Vertex,E extends Edge<V>>
vertex
- vertex to be removedpublic void addEdge(E edge)
MutableGraph
public void removeEdge(E edge)
MutableGraph
removeEdge
in interface MutableGraph<V extends Vertex,E extends Edge<V>>
edge
- edge to be removedpublic Graph<V,E> toImmutable()
MutableGraph
toImmutable
in interface MutableGraph<V extends Vertex,E extends Edge<V>>
public void clear()