public class DynamicGraph<T> extends java.lang.Object implements IDynamicGraph<T>
| Modifier and Type | Class and Description |
|---|---|
private static class |
DynamicGraph.Edges<T>
Manage edges and weights between nodes.
|
IDynamicGraph.Status| Modifier and Type | Field and Description |
|---|---|
private DynamicGraph.Edges<T> |
m_edges |
private java.util.Set<T> |
m_nodesFinished |
private java.util.Set<T> |
m_nodesReady |
private java.util.Set<T> |
m_nodesRunning |
private java.util.Set<IExecutionVisualiser> |
visualisers |
| Constructor and Description |
|---|
DynamicGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(int weight,
T from,
T to) |
void |
addEdges(int weight,
T from,
java.lang.Iterable<T> tos)
Add an edge between two nodes.
|
boolean |
addNode(T node)
Add a node to the graph.
|
private static <T> java.lang.String |
dotShortName(T t) |
java.util.List<T> |
getDependenciesFor(T node) |
(package private) java.util.Map<T,java.util.Map<T,java.lang.Integer>> |
getEdges()
For tests only
|
java.util.List<T> |
getFreeNodes() |
int |
getNodeCount() |
int |
getNodeCountWithStatus(IDynamicGraph.Status status) |
java.util.Set<T> |
getNodesWithStatus(IDynamicGraph.Status status) |
void |
setStatus(java.util.Collection<T> nodes,
IDynamicGraph.Status status)
Set the status for a set of nodes.
|
void |
setStatus(T node,
IDynamicGraph.Status status)
Set the status for a node.
|
void |
setVisualisers(java.util.Set<IExecutionVisualiser> listener) |
java.lang.String |
toDot() |
java.lang.String |
toString() |
private final java.util.Set<T> m_nodesReady
private final java.util.Set<T> m_nodesRunning
private final java.util.Set<T> m_nodesFinished
private final DynamicGraph.Edges<T> m_edges
private java.util.Set<IExecutionVisualiser> visualisers
public boolean addNode(T node)
addNode in interface IDynamicGraph<T>public void addEdge(int weight,
T from,
T to)
addEdge in interface IDynamicGraph<T>weight - - Represents one of TestRunner.PriorityWeight ordinals
indicating the weightage of a particular node in the graphfrom - - Represents the edge that depends on another edge.to - - Represents the edge on which another edge depends upon.public void setVisualisers(java.util.Set<IExecutionVisualiser> listener)
setVisualisers in interface IDynamicGraph<T>public void addEdges(int weight,
T from,
java.lang.Iterable<T> tos)
addEdges in interface IDynamicGraph<T>public java.util.List<T> getFreeNodes()
getFreeNodes in interface IDynamicGraph<T>public java.util.List<T> getDependenciesFor(T node)
getDependenciesFor in interface IDynamicGraph<T>public void setStatus(java.util.Collection<T> nodes, IDynamicGraph.Status status)
setStatus in interface IDynamicGraph<T>public void setStatus(T node, IDynamicGraph.Status status)
setStatus in interface IDynamicGraph<T>public int getNodeCount()
getNodeCount in interface IDynamicGraph<T>public int getNodeCountWithStatus(IDynamicGraph.Status status)
getNodeCountWithStatus in interface IDynamicGraph<T>public java.util.Set<T> getNodesWithStatus(IDynamicGraph.Status status)
getNodesWithStatus in interface IDynamicGraph<T>public java.lang.String toString()
toString in class java.lang.Objectprivate static <T> java.lang.String dotShortName(T t)
public java.lang.String toDot()
toDot in interface IDynamicGraph<T>