From a3a95154666eb0fbae948173d13ad72c5509b1c4 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 29 Feb 2016 09:05:36 -0500 Subject: Factored interface out of GenHolder --- BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java b/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java index ca3d06f..3b54b27 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java +++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java @@ -14,6 +14,7 @@ import java.util.function.BiConsumer; import java.util.function.BiPredicate; import bjc.utils.data.GenHolder; +import bjc.utils.data.IHolder; /** * A directed weighted graph, where the vertices have some arbitrary label @@ -136,7 +137,7 @@ public class Graph { Set visited = new HashSet(); // Start at the initial vertex and visit it - GenHolder src = new GenHolder<>(getInitial()); + IHolder src = new GenHolder<>(getInitial()); visited.add(src.unwrap(vl -> vl)); // Make sure we visit all the nodes @@ -149,7 +150,7 @@ public class Graph { src.unwrap(vl -> vl), tgt, weight))); // Get the edge with the minimum distance - GenHolder> minEdge = new GenHolder<>( + IHolder> minEdge = new GenHolder<>( availEdges.poll()); // Only consider edges where we haven't visited the target of -- cgit v1.2.3