summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
diff options
context:
space:
mode:
authorEVE <EVE@EVE-PC>2017-03-13 16:42:21 -0400
committerEVE <EVE@EVE-PC>2017-03-13 16:42:21 -0400
commit27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd (patch)
tree847fb52acb091c1c613d37b8477094d5762c6988 /BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
parentaa807a96cae2c47259fb38f710640883060339e9 (diff)
Formatting
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java27
1 files changed, 11 insertions, 16 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java b/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
index 2ad4132..c77c0ba 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
@@ -6,36 +6,34 @@ package bjc.utils.graph;
* @author ben
*
* @param <T>
- * The type of the nodes in the graph
+ * The type of the nodes in the graph
*/
public class Edge<T> {
/*
* The distance from initial to terminal node
*/
- private final int distance;
+ private final int distance;
/*
* The initial and terminal nodes of this edge
*/
- private final T source, target;
+ private final T source, target;
/**
* Create a new edge with set parameters
*
* @param initial
- * The initial node of the edge
+ * The initial node of the edge
* @param terminal
- * The terminal node of the edge
+ * The terminal node of the edge
* @param distance
- * The distance between initial and terminal edge
+ * The distance between initial and terminal edge
*/
public Edge(T initial, T terminal, int distance) {
if (initial == null) {
- throw new NullPointerException(
- "Initial node must not be null");
+ throw new NullPointerException("Initial node must not be null");
} else if (terminal == null) {
- throw new NullPointerException(
- "Terminal node must not be null");
+ throw new NullPointerException("Terminal node must not be null");
}
this.source = initial;
@@ -109,17 +107,14 @@ public class Edge<T> {
int result = 1;
result = prime * result + distance;
- result = prime * result
- + ((source == null) ? 0 : source.hashCode());
- result = prime * result
- + ((target == null) ? 0 : target.hashCode());
+ result = prime * result + ((source == null) ? 0 : source.hashCode());
+ result = prime * result + ((target == null) ? 0 : target.hashCode());
return result;
}
@Override
public String toString() {
- return " first vertex " + source + " to vertex " + target
- + " with distance: " + distance;
+ return " first vertex " + source + " to vertex " + target + " with distance: " + distance;
}
}