diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-29 08:40:12 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-29 08:40:12 +0200 |
commit | ee6931fb82c04aa94ceaab76e91925adcb493998 (patch) | |
tree | b8431ce4485c6e941f3e5ab38d1b78d487530246 /src/com.example.portfolio3 | |
parent | 56362295799741bec6ffe5c7713dbc2f1ee86dd7 (diff) |
tidy whitespace
Diffstat (limited to 'src/com.example.portfolio3')
5 files changed, 10 insertions, 10 deletions
diff --git a/src/com.example.portfolio3/com/example/portfolio3/AbstractGraph.java b/src/com.example.portfolio3/com/example/portfolio3/AbstractGraph.java index 054fa65..514ac1e 100644 --- a/src/com.example.portfolio3/com/example/portfolio3/AbstractGraph.java +++ b/src/com.example.portfolio3/com/example/portfolio3/AbstractGraph.java @@ -13,7 +13,7 @@ public abstract class AbstractGraph implements Graph { AbstractGraph() { } /// foo - private HashMap<String,Vertex> vertexMap = new HashMap<>(); + private HashMap<String, Vertex> vertexMap = new HashMap<>(); /// foo private HashSet<Vertex> vertexSet = new HashSet<>(); diff --git a/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java b/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java index f6e1130..8484d58 100644 --- a/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java +++ b/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java @@ -15,7 +15,7 @@ public class AdjListGraph extends AbstractGraph { public AdjListGraph() { } /// foo - private Map<Vertex,Set<Edge>> outEdge = new HashMap<>(); + private Map<Vertex, Set<Edge>> outEdge = new HashMap<>(); /// foo public final void insertEdge(final Vertex v1, final Vertex v2, final int w) { diff --git a/src/com.example.portfolio3/com/example/portfolio3/AdjMapGraph.java b/src/com.example.portfolio3/com/example/portfolio3/AdjMapGraph.java index b538f24..8c2c139 100644 --- a/src/com.example.portfolio3/com/example/portfolio3/AdjMapGraph.java +++ b/src/com.example.portfolio3/com/example/portfolio3/AdjMapGraph.java @@ -19,7 +19,7 @@ class AdjMapGraph extends AbstractGraph { /// foo public void insertEdge(final Vertex v1, final Vertex v2, final int w) { - Edge e = new Edge(v1,v2, w); + Edge e = new Edge(v1, v2, w); if (!outEdge.containsKey(e.from())) { outEdge.put(e.from(), new HashMap<Vertex, Edge>()); } diff --git a/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java b/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java index 0fbc3ed..4d8a8c2 100644 --- a/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java +++ b/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java @@ -57,7 +57,7 @@ public class GraphAlgorithms { public static Integer pathLength(final Graph g, final List<Vertex> path) { int length = 0; for (int i = 1; i < path.size(); i++) { - Integer w = g.getWeight(path.get(i - 1),path.get(i)); + Integer w = g.getWeight(path.get(i - 1), path.get(i)); if (w == null) { return null; } @@ -292,8 +292,8 @@ public class GraphAlgorithms { // create table for done, prev and weight from start int maxint = Integer.MAX_VALUE; HashSet<Vertex> done = new HashSet<>(); - HashMap<Vertex,Edge> prev = new HashMap<>(); - HashMap<Vertex,Integer> weight = new HashMap<>(); + HashMap<Vertex, Edge> prev = new HashMap<>(); + HashMap<Vertex, Integer> weight = new HashMap<>(); for (Vertex w: g.vertices()) { weight.put(w, maxint); } @@ -337,8 +337,8 @@ public class GraphAlgorithms { } } done.add(nearest); - prev.put(nearest,done2near); - weight.put(nearest,neardist); + prev.put(nearest, done2near); + weight.put(nearest, neardist); } return new HashSet<Edge>(prev.values()); diff --git a/src/com.example.portfolio3/com/example/portfolio3/MatrixGraph.java b/src/com.example.portfolio3/com/example/portfolio3/MatrixGraph.java index 463bf8d..41d5880 100644 --- a/src/com.example.portfolio3/com/example/portfolio3/MatrixGraph.java +++ b/src/com.example.portfolio3/com/example/portfolio3/MatrixGraph.java @@ -64,7 +64,7 @@ public class MatrixGraph extends AbstractGraph { if (weight == null) { continue; } - edges.add(new Edge(index2vertex[i],index2vertex[j],weight)); + edges.add(new Edge(index2vertex[i], index2vertex[j], weight)); } } @@ -80,7 +80,7 @@ public class MatrixGraph extends AbstractGraph { if (weight == null) { continue; } - edges.add(new Edge(v1,index2vertex[j],weight)); + edges.add(new Edge(v1, index2vertex[j], weight)); } return edges; |