From 69a769bc6474d71f5108af0698dd5454319e2a6c Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Sun, 25 Jun 2023 15:09:13 -0400 Subject: Fix a few warnings --- base/src/main/java/bjc/utils/graph/AdjacencyMap.java | 1 + base/src/main/java/bjc/utils/graph/Edge.java | 1 + base/src/main/java/bjc/utils/graph/Graph.java | 12 ++---------- base/src/main/java/bjc/utils/graph/Graphs.java | 10 ++++++++++ 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'base/src/main/java/bjc/utils/graph') diff --git a/base/src/main/java/bjc/utils/graph/AdjacencyMap.java b/base/src/main/java/bjc/utils/graph/AdjacencyMap.java index 04fe4c8..f03fb69 100644 --- a/base/src/main/java/bjc/utils/graph/AdjacencyMap.java +++ b/base/src/main/java/bjc/utils/graph/AdjacencyMap.java @@ -21,6 +21,7 @@ import bjc.utils.funcutils.FuncUtils; * * @param * The type of the nodes in the graph + * @param The type of the weights */ public class AdjacencyMap { /** diff --git a/base/src/main/java/bjc/utils/graph/Edge.java b/base/src/main/java/bjc/utils/graph/Edge.java index 5b0eba3..bffa0a1 100644 --- a/base/src/main/java/bjc/utils/graph/Edge.java +++ b/base/src/main/java/bjc/utils/graph/Edge.java @@ -8,6 +8,7 @@ import java.util.Objects; * @author ben * * @param The type of the nodes in the graph. + * @param The type of the weight */ public class Edge { /* The distance from initial to terminal node. */ diff --git a/base/src/main/java/bjc/utils/graph/Graph.java b/base/src/main/java/bjc/utils/graph/Graph.java index 81653fc..a007698 100644 --- a/base/src/main/java/bjc/utils/graph/Graph.java +++ b/base/src/main/java/bjc/utils/graph/Graph.java @@ -1,20 +1,11 @@ package bjc.utils.graph; -import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import java.util.NoSuchElementException; -import java.util.PriorityQueue; -import java.util.Queue; -import java.util.Set; import java.util.function.BiConsumer; import java.util.function.BiPredicate; -import bjc.data.Holder; -import bjc.data.Identity; -import bjc.funcdata.FunctionalMap; -import bjc.funcdata.ListEx; -import bjc.funcdata.MapEx; +import bjc.funcdata.*; /** * A directed weighted graph, where the vertices have some arbitrary label. @@ -23,6 +14,7 @@ import bjc.funcdata.MapEx; * * @param * The label for vertices. + * @param The label for edges */ public class Graph { /** diff --git a/base/src/main/java/bjc/utils/graph/Graphs.java b/base/src/main/java/bjc/utils/graph/Graphs.java index 2844a68..f504b55 100644 --- a/base/src/main/java/bjc/utils/graph/Graphs.java +++ b/base/src/main/java/bjc/utils/graph/Graphs.java @@ -5,11 +5,21 @@ import java.util.*; import bjc.data.Holder; import bjc.data.Identity; +/** + * General graph utilities + * @author bjcul + * + */ public class Graphs { /** * Uses Prim's algorithm to calculate a MST for the graph. * * If the graph is non-connected, this will lead to unpredictable results. + * + * @param grap The graph to calculate MST for + * @param comp The comparator for the edges + * @param The vertex type + * @param The edge type * * @return A list of edges that constitute the MST. */ -- cgit v1.2.3