summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2016-04-22 14:48:04 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2016-04-22 14:48:04 -0400
commit42f7d379a430aaf2fad169f0170de04072b08b10 (patch)
tree5d46b43b2d9272f4e593820ee147b3ae3f0d82b0 /BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java
parentb65b705c391bb772bc41269bce5243c1cc88969d (diff)
Formatting changes
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.java42
1 files changed, 21 insertions, 21 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 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
@@ -26,6 +26,27 @@ import bjc.utils.funcdata.IFunctionalMap;
*/
public class Graph<T> {
/**
+ * Create a graph from a list of edges
+ *
+ * @param <E>
+ * 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 <E> Graph<E> fromEdgeList(List<Edge<E>> edges) {
+ Graph<E> g = new Graph<>();
+
+ edges.forEach(edge -> {
+ g.addEdge(edge.getSource(), edge.getTarget(),
+ edge.getDistance(), true);
+ });
+
+ return g;
+ }
+
+ /**
* The backing representation of the graph
*/
private final IFunctionalMap<T, IFunctionalMap<T, Integer>> backingGraph;
@@ -265,25 +286,4 @@ public class Graph<T> {
return adjacencyMap;
}
-
- /**
- * Create a graph from a list of edges
- *
- * @param <E>
- * 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 <E> Graph<E> fromEdgeList(List<Edge<E>> edges) {
- Graph<E> g = new Graph<>();
-
- edges.forEach(edge -> {
- g.addEdge(edge.getSource(), edge.getTarget(),
- edge.getDistance(), true);
- });
-
- return g;
- }
}