From 889fac2bdf993dc86f64a8893c0260fdcf848acb Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:40:33 -0400 Subject: Cleanup --- BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java') 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 { * @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 { } @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; } -- cgit v1.2.3