T
- the type of the data to store in Vertices of this graphpublic abstract class DirectedGraph<T> extends java.lang.Object implements Graph<T>
Constructor and Description |
---|
DirectedGraph()
Creates a new directed graph
|
DirectedGraph(java.util.Collection<T> vertexData)
Creates a new directed graph with the given data in vertices
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<DirectedEdge<T>> |
getEdges()
Gets all the edges in the graph
|
java.util.Set<DirectedVertex<T>> |
getVertices()
Gets all the vertices in the graph
|
void |
removeAllEdges()
Deletes all the edges in the graph
|
void |
removeAllVertices()
Deletes all the vertices in the graph
|
java.lang.String |
toString() |
public DirectedGraph()
public DirectedGraph(java.util.Collection<T> vertexData)
vertexData
- the data to make vertices out ofpublic java.util.Set<DirectedEdge<T>> getEdges()
Graph
public java.util.Set<DirectedVertex<T>> getVertices()
Graph
getVertices
in interface Graph<T>
public void removeAllEdges()
Graph
removeAllEdges
in interface Graph<T>
public void removeAllVertices()
Graph
removeAllVertices
in interface Graph<T>
public java.lang.String toString()
toString
in class java.lang.Object