public class DirectedGraph<T extends Comparable<? super T>> extends Object
| Constructor and Description |
|---|
DirectedGraph(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(T from,
T to)
Adds vertices, and a directed edge between them.
|
Vertex<T> |
addVertex(T value)
Adds a vertex.
|
Set<DirectedEdge<T>> |
edgeSet() |
String |
getName() |
Set<DirectedEdge<T>> |
getOutgoingEdges(Vertex<T> vertexFrom) |
String |
toString() |
Set<Vertex<T>> |
vertexSet() |
public DirectedGraph(String name)
public void addEdge(T from, T to)
from - Vertex value at the start of the edgeto - Vertex value at the end of the edgepublic Vertex<T> addVertex(T value)
value - Vertex valuepublic Set<DirectedEdge<T>> edgeSet()
public String getName()
public Set<DirectedEdge<T>> getOutgoingEdges(Vertex<T> vertexFrom)
Copyright © 2000-2022 Sualeh Fatehi. All rights reserved.