T
- the type of the data to store in Vertices of this graphpublic class UnweightedDirectedGraph<T> extends DirectedGraph<T> implements UnweightedGraph<T>
Constructor and Description |
---|
UnweightedDirectedGraph()
Creates a new unweighted directed graph
|
UnweightedDirectedGraph(java.util.Collection<T> vertexData)
Creates a new unweighted directed graph with the given data in vertices
|
UnweightedDirectedGraph(MultiMap<T,T> connections)
Creates a new unweighted directed graph with the connections described by
a multimap.
|
Modifier and Type | Method and Description |
---|---|
DirectedEdge<T> |
addEdge(Vertex<T> source,
Vertex<T> target)
Adds an edge to the graph between two Vertices
|
UnweightedDirectedVertex<T> |
addVertex(T data)
Adds a new vertex to the graph with the given data
|
getEdges, getVertices, removeAllEdges, removeAllVertices, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEdges, getVertices, removeAllEdges, removeAllVertices
public UnweightedDirectedGraph()
public UnweightedDirectedGraph(java.util.Collection<T> vertexData)
vertexData
- the data to make vertices out ofpublic DirectedEdge<T> addEdge(Vertex<T> source, Vertex<T> target)
UnweightedGraph
addEdge
in interface UnweightedGraph<T>
source
- the Vertex the edge starts at (arbitrary for undirected
graphs)target
- the Vertex the edge ends at (arbitrary for undirected graphs)