summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java
index 91662950..60d57785 100644
--- a/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java
+++ b/opendc-simulator/opendc-simulator-flow/src/main/java/org/opendc/simulator/engine/graph/FlowGraph.java
@@ -76,7 +76,7 @@ public class FlowGraph {
/**
* Add an edge between the specified consumer and supplier in this graph.
*/
- public void addEdge(FlowConsumer flowConsumer, FlowSupplier flowSupplier) {
+ public FlowEdge addEdge(FlowConsumer flowConsumer, FlowSupplier flowSupplier) {
// Check if the consumer and supplier are both FlowNodes
if (!(flowConsumer instanceof FlowNode)) {
throw new IllegalArgumentException("Flow consumer is not a FlowNode");
@@ -99,6 +99,8 @@ public class FlowGraph {
nodeToEdge.get((FlowNode) flowConsumer).add(flowEdge);
nodeToEdge.get((FlowNode) flowSupplier).add(flowEdge);
+
+ return flowEdge;
}
public void removeEdge(FlowEdge flowEdge) {