diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-02-29 09:05:36 -0500 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-02-29 09:05:36 -0500 |
| commit | a3a95154666eb0fbae948173d13ad72c5509b1c4 (patch) | |
| tree | 6230da28df025803241cea23895d2f1777329ab7 /BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java | |
| parent | c732b309a14696f60100440871c90789d443ad24 (diff) | |
Factored interface out of GenHolder
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java | 5 |
1 files changed, 3 insertions, 2 deletions
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<T> { Set<T> visited = new HashSet<T>(); // Start at the initial vertex and visit it - GenHolder<T> src = new GenHolder<>(getInitial()); + IHolder<T> src = new GenHolder<>(getInitial()); visited.add(src.unwrap(vl -> vl)); // Make sure we visit all the nodes @@ -149,7 +150,7 @@ public class Graph<T> { src.unwrap(vl -> vl), tgt, weight))); // Get the edge with the minimum distance - GenHolder<Edge<T>> minEdge = new GenHolder<>( + IHolder<Edge<T>> minEdge = new GenHolder<>( availEdges.poll()); // Only consider edges where we haven't visited the target of |
