public class Graph<T> extends Object
Modifier and Type | Class and Description |
---|---|
class |
Graph.Edge |
Constructor and Description |
---|
Graph() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Graph.Edge anEdge) |
void |
addNode(T aNode) |
Set<Graph.Edge> |
getEdges() |
Set<Graph.Edge> |
getEdgesEndingWith(T aNode)
Obtains the edges ending with a given node
|
T |
getNode(T element) |
Set<T> |
getNodes() |
List<T> |
topologicalSort()
Sort a graph in topological order
|
public void addNode(T aNode)
public void addEdge(Graph.Edge anEdge)
public Set<Graph.Edge> getEdges()
public Set<Graph.Edge> getEdgesEndingWith(T aNode)
aNode
- public List<T> topologicalSort() throws CycleException
CycleException
Copyright © 2024 OpenMRS Inc.. All rights reserved.