diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-10 16:40:33 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-10 16:40:33 -0400 |
| commit | 889fac2bdf993dc86f64a8893c0260fdcf848acb (patch) | |
| tree | 99ed08552efa86fdc5fdf4ddb8720d10e599fafe /BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java | |
| parent | 1656b02144446aeedebb3d1179e07ed99c01861c (diff) | |
Cleanup
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.java | 30 |
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; } |
