From a2c7425458f645802a352abc4783e0afc73dba13 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Thu, 3 Dec 2020 19:22:35 -0500 Subject: Adapt to esodata changes --- base/src/main/java/bjc/utils/graph/AdjacencyMap.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'base/src/main/java/bjc/utils/graph/AdjacencyMap.java') diff --git a/base/src/main/java/bjc/utils/graph/AdjacencyMap.java b/base/src/main/java/bjc/utils/graph/AdjacencyMap.java index 46d27f5..978b21d 100644 --- a/base/src/main/java/bjc/utils/graph/AdjacencyMap.java +++ b/base/src/main/java/bjc/utils/graph/AdjacencyMap.java @@ -6,12 +6,12 @@ import java.io.PrintStream; import java.util.InputMismatchException; import java.util.Scanner; -import bjc.data.IHolder; +import bjc.data.Holder; import bjc.data.Identity; import bjc.funcdata.FunctionalList; import bjc.funcdata.FunctionalMap; -import bjc.funcdata.IList; -import bjc.funcdata.IMap; +import bjc.funcdata.ListEx; +import bjc.funcdata.MapEx; import bjc.utils.funcutils.FuncUtils; /** @@ -62,13 +62,13 @@ public class AdjacencyMap { if (vertexCount <= 0) throw new InputMismatchException( "The number of vertices must be greater than 0"); - final IList vertices = new FunctionalList<>(); + final ListEx vertices = new FunctionalList<>(); FuncUtils.doTimes(vertexCount, vertexNo -> vertices.add(vertexNo)); adjacency = new AdjacencyMap<>(vertices); - final IHolder row = new Identity<>(0); + final Holder row = new Identity<>(0); input.forEachRemaining(strang -> { readRow(adjacency, vertexCount, row, strang); @@ -80,7 +80,7 @@ public class AdjacencyMap { /* Read a row of edges. */ private static void readRow(final AdjacencyMap adjacency, - final int vertexCount, final IHolder row, final String strang) { + final int vertexCount, final Holder row, final String strang) { final String[] parts = strang.split(" "); if (parts.length != vertexCount) { @@ -115,7 +115,7 @@ public class AdjacencyMap { } /** The backing storage of the map */ - private final IMap> adjacency = new FunctionalMap<>(); + private final MapEx> adjacency = new FunctionalMap<>(); /** * Create a new map from a set of vertices @@ -123,11 +123,11 @@ public class AdjacencyMap { * @param vertices * The set of vertices to create a map from */ - public AdjacencyMap(final IList vertices) { + public AdjacencyMap(final ListEx vertices) { if (vertices == null) throw new NullPointerException("Vertices must not be null"); vertices.forEach(vertex -> { - final IMap row = new FunctionalMap<>(); + final MapEx row = new FunctionalMap<>(); vertices.forEach(target -> { row.put(target, 0); @@ -143,7 +143,7 @@ public class AdjacencyMap { * @return Whether or not the graph is directed */ public boolean isDirected() { - final IHolder result = new Identity<>(true); + final Holder result = new Identity<>(true); adjacency.forEach((sourceKey, sourceValue) -> { sourceValue.forEach((targetKey, targetValue) -> { -- cgit v1.2.3