From 42f7d379a430aaf2fad169f0170de04072b08b10 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 22 Apr 2016 14:48:04 -0400 Subject: Formatting changes --- .../src/main/java/bjc/utils/graph/Graph.java | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 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 fbaf3f6..0574325 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java +++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java @@ -25,6 +25,27 @@ import bjc.utils.funcdata.IFunctionalMap; * The label for vertices */ public class Graph { + /** + * Create a graph from a list of edges + * + * @param + * The type of data stored in the edges + * + * @param edges + * The list of edges to build from + * @return A graph built from the provided edge-list + */ + public static Graph fromEdgeList(List> edges) { + Graph g = new Graph<>(); + + edges.forEach(edge -> { + g.addEdge(edge.getSource(), edge.getTarget(), + edge.getDistance(), true); + }); + + return g; + } + /** * The backing representation of the graph */ @@ -265,25 +286,4 @@ public class Graph { return adjacencyMap; } - - /** - * Create a graph from a list of edges - * - * @param - * The type of data stored in the edges - * - * @param edges - * The list of edges to build from - * @return A graph built from the provided edge-list - */ - public static Graph fromEdgeList(List> edges) { - Graph g = new Graph<>(); - - edges.forEach(edge -> { - g.addEdge(edge.getSource(), edge.getTarget(), - edge.getDistance(), true); - }); - - return g; - } } -- cgit v1.2.3