summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
diff options
context:
space:
mode:
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.java30
1 files changed, 15 insertions, 15 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 37aff29..0152e3d 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
@@ -29,10 +29,10 @@ public class Edge<T> {
* @param distance
* The distance between initial and terminal edge
*/
- public Edge(T initial, T terminal, int distance) {
- if(initial == null)
+ public Edge(final T initial, final T terminal, final int distance) {
+ if (initial == null)
throw new NullPointerException("Initial node must not be null");
- else if(terminal == null) throw new NullPointerException("Terminal node must not be null");
+ else if (terminal == null) throw new NullPointerException("Terminal node must not be null");
this.source = initial;
this.target = terminal;
@@ -40,25 +40,25 @@ public class Edge<T> {
}
@Override
- public boolean equals(Object obj) {
- if(this == obj)
+ public boolean equals(final Object obj) {
+ if (this == obj)
return true;
- else if(obj == null)
+ else if (obj == null)
return false;
- else if(getClass() != obj.getClass())
+ else if (getClass() != obj.getClass())
return false;
else {
- Edge<?> other = (Edge<?>) obj;
+ final Edge<?> other = (Edge<?>) obj;
- if(distance != other.distance)
+ if (distance != other.distance)
return false;
- else if(source == null) {
- if(other.source != null) return false;
- } else if(!source.equals(other.source))
+ else if (source == null) {
+ if (other.source != null) return false;
+ } else if (!source.equals(other.source))
return false;
- else if(target == null) {
- if(other.target != null) return false;
- } else if(!target.equals(other.target)) return false;
+ else if (target == null) {
+ if (other.target != null) return false;
+ } else if (!target.equals(other.target)) return false;
return true;
}