public class Graph<T>
extends java.lang.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) |
java.util.Set<Graph.Edge> |
getEdges() |
java.util.Set<Graph.Edge> |
getEdgesEndingWith(T aNode)
Obtains the edges ending with a given node
|
T |
getNode(T element) |
java.util.Set<T> |
getNodes() |
java.util.List<T> |
topologicalSort()
Sort a graph in topological order
|
public void addNode(T aNode)
public void addEdge(Graph.Edge anEdge)
public java.util.Set<T> getNodes()
public java.util.Set<Graph.Edge> getEdges()
public java.util.Set<Graph.Edge> getEdgesEndingWith(T aNode)
aNode
- public java.util.List<T> topologicalSort() throws CycleException
CycleException
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.