From 410b497ec29155f46a4945586e05c8b6e0b122cd Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Mon, 12 Oct 2015 20:20:39 -0700 Subject: [PATCH] Add a nodes value to DynamicGraph. --- src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt b/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt index 7052804f..f6a3673f 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt @@ -104,6 +104,7 @@ public class DynamicGraph : KobaltLogger { * Add a node to the graph. */ public fun addNode(value: T) : T { + nodes.add(value) nodesReady.add(value) return value } @@ -113,6 +114,8 @@ public class DynamicGraph : KobaltLogger { * (they will be added by this method). Makes "to" depend on "from". */ public fun addEdge(from: T, to: T) { + nodes.add(from) + nodes.add(to) val fromNode = addNode(from) val toNode = addNode(to) dependingOn.put(toNode, fromNode) @@ -234,7 +237,7 @@ public class DynamicGraph : KobaltLogger { return result.toString(); } - val nodes : Set get() = nodesReady + val nodes = hashSetOf() fun dump() : String { val result = StringBuffer()