summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/graph
diff options
context:
space:
mode:
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java12
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java10
2 files changed, 11 insertions, 11 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java b/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
index 32d3b34..ff9103e 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
@@ -10,8 +10,8 @@ import bjc.utils.data.IHolder;
import bjc.utils.data.Identity;
import bjc.utils.funcdata.FunctionalList;
import bjc.utils.funcdata.FunctionalMap;
-import bjc.utils.funcdata.IFunctionalList;
-import bjc.utils.funcdata.IFunctionalMap;
+import bjc.utils.funcdata.IList;
+import bjc.utils.funcdata.IMap;
import bjc.utils.funcutils.FuncUtils;
/**
@@ -65,7 +65,7 @@ public class AdjacencyMap<T> {
"The number of vertices must be greater than 0");
}
- IFunctionalList<Integer> vertices = new FunctionalList<>();
+ IList<Integer> vertices = new FunctionalList<>();
FuncUtils.doTimes(numVertices,
(vertexNo) -> vertices.add(vertexNo));
@@ -119,7 +119,7 @@ public class AdjacencyMap<T> {
/**
* The backing storage of the map
*/
- private IFunctionalMap<T, IFunctionalMap<T, Integer>> adjacencyMap = new FunctionalMap<>();
+ private IMap<T, IMap<T, Integer>> adjacencyMap = new FunctionalMap<>();
/**
* Create a new map from a set of vertices
@@ -127,13 +127,13 @@ public class AdjacencyMap<T> {
* @param vertices
* The set of vertices to create a map from
*/
- public AdjacencyMap(IFunctionalList<T> vertices) {
+ public AdjacencyMap(IList<T> vertices) {
if (vertices == null) {
throw new NullPointerException("Vertices must not be null");
}
vertices.forEach(vertex -> {
- IFunctionalMap<T, Integer> vertexRow = new FunctionalMap<>();
+ IMap<T, Integer> vertexRow = new FunctionalMap<>();
vertices.forEach(targetVertex -> {
vertexRow.put(targetVertex, 0);
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 0574325..798d20d 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java
@@ -13,8 +13,8 @@ import java.util.function.BiPredicate;
import bjc.utils.data.IHolder;
import bjc.utils.data.Identity;
import bjc.utils.funcdata.FunctionalMap;
-import bjc.utils.funcdata.IFunctionalList;
-import bjc.utils.funcdata.IFunctionalMap;
+import bjc.utils.funcdata.IList;
+import bjc.utils.funcdata.IMap;
/**
* A directed weighted graph, where the vertices have some arbitrary label
@@ -49,7 +49,7 @@ public class Graph<T> {
/**
* The backing representation of the graph
*/
- private final IFunctionalMap<T, IFunctionalMap<T, Integer>> backingGraph;
+ private final IMap<T, IMap<T, Integer>> backingGraph;
/**
* Create a new graph
@@ -135,7 +135,7 @@ public class Graph<T> {
* The vertex to use as a source
* @return All of the edges with the specified vertex as a source
*/
- public IFunctionalMap<T, Integer> getEdges(T source) {
+ public IMap<T, Integer> getEdges(T source) {
// Can't find edges for a null source
if (source == null) {
throw new NullPointerException("The source cannot be null.");
@@ -230,7 +230,7 @@ public class Graph<T> {
*
* @return A unmodifiable set of all the vertices in the graph.
*/
- public IFunctionalList<T> getVertices() {
+ public IList<T> getVertices() {
return backingGraph.keyList();
}