summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2017-02-10 08:40:36 -0500
committerbculkin2442 <bjculkin@mix.wvu.edu>2017-02-10 08:40:36 -0500
commit1a8376548d7d448e0d4e2373cf3308cc85c2c0bd (patch)
treeb13ddf3ccb2e196c63b52a935b61868db404e77a /BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
parentd2af58b0f68ebfbba2be7e7679efec6c8c0af12f (diff)
Bugfixes/Simplification
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java8
1 files changed, 4 insertions, 4 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 2f6d91a..c04aa23 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/graph/AdjacencyMap.java
@@ -135,7 +135,7 @@ public class AdjacencyMap<T> {
IMap<T, Integer> row = new FunctionalMap<>();
vertices.forEach(target -> {
- row.put(target 0);
+ row.put(target, 0);
});
adjacency.put(vertex, row);
@@ -173,7 +173,7 @@ public class AdjacencyMap<T> {
* @param weight
* The weight of the edge
*/
- public void setWeight(T source, T target int weight) {
+ public void setWeight(T source, T target, int weight) {
if (source == null) {
throw new NullPointerException(
"Source vertex must not be null");
@@ -185,12 +185,12 @@ public class AdjacencyMap<T> {
if (!adjacency.containsKey(source)) {
throw new IllegalArgumentException("Source vertex "
+ source + " isn't present in map");
- } else if (!adjacency.containsKey(target) {
+ } else if (!adjacency.containsKey(target)) {
throw new IllegalArgumentException("Target vertex "
+ target+ " isn't present in map");
}
- adjacency.get(source).put(target weight);
+ adjacency.get(source).put(target, weight);
}
/**