| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected Map | nodes
Map from node payload to node containing it |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public Graph. | |
| public List |
| nodes | back to summary |
|---|---|
| protected Map<T, Graph. Map from node payload to node containing it | |
| Graph | back to summary |
|---|---|
| public Graph() | |
| addEdge | back to summary |
|---|---|
| public void addEdge(T a, T b) | |
| DFS | back to summary |
|---|---|
| public void DFS(Graph. | |
| getNode | back to summary |
|---|---|
| public Graph. | |
| sort | back to summary |
|---|---|
| public List DFS-based topological sort. A valid sort is the reverse of the post-order DFA traversal. Amazingly simple but true. For sorting, I'm not following convention here since ANTLR needs the opposite. Here's what I assume for sorting: If there exists an edge u -> v then u depends on v and v must happen before u. So if this gives nonreversed postorder traversal, I get the order I want. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public String |
| edges | back to summary |
|---|---|
public List<Graph.
| |
| payload | back to summary |
|---|---|
| public T payload | |
| Node | back to summary |
|---|---|
| public Node(T payload) | |
| addEdge | back to summary |
|---|---|
| public void addEdge(Graph. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |