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.java80
1 files changed, 40 insertions, 40 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 58a233a..fa34083 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Edge.java
@@ -43,6 +43,43 @@ public class Edge<T> {
this.distance = distance;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ } else if (obj == null) {
+ return false;
+ } else if (getClass() != obj.getClass()) {
+ return false;
+ } else {
+
+ Edge<?> other = (Edge<?>) obj;
+
+ if (distance != other.distance) {
+ return false;
+ } 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;
+ }
+
+ return true;
+ }
+ }
+
/**
* Get the distance in this edge
*
@@ -71,12 +108,6 @@ public class Edge<T> {
return target;
}
- @Override
- public String toString() {
- return " first vertex " + source + " to vertex " + target
- + " with distance: " + distance;
- }
-
/*
* (non-Javadoc)
*
@@ -94,40 +125,9 @@ public class Edge<T> {
return result;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
@Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- } else if (obj == null) {
- return false;
- } else if (getClass() != obj.getClass()) {
- return false;
- } else {
-
- Edge<?> other = (Edge<?>) obj;
-
- if (distance != other.distance) {
- return false;
- } 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;
- }
-
- return true;
- }
+ public String toString() {
+ return " first vertex " + source + " to vertex " + target
+ + " with distance: " + distance;
}
}