Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
- Timestamp:
- 2016-01-09T23:20:37+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
r7509 r9371 3 3 4 4 import java.io.Serializable; 5 import java.util.Objects; 5 6 6 7 import org.openstreetmap.josm.data.osm.BBox; … … 113 114 } 114 115 115 protected final int computeHashCode(int init) {116 final int prime = 31;117 int result = init;118 long temp;119 temp = java.lang.Double.doubleToLongBits(x);120 result = prime * result + (int) (temp ^ (temp >>> 32));121 temp = java.lang.Double.doubleToLongBits(y);122 result = prime * result + (int) (temp ^ (temp >>> 32));123 return result;124 }125 126 @Override127 public int hashCode() {128 return computeHashCode(1);129 }130 131 @Override132 public boolean equals(Object obj) {133 if (this == obj)134 return true;135 if (obj == null || getClass() != obj.getClass())136 return false;137 Coordinate other = (Coordinate) obj;138 if (java.lang.Double.doubleToLongBits(x) != java.lang.Double.doubleToLongBits(other.x))139 return false;140 if (java.lang.Double.doubleToLongBits(y) != java.lang.Double.doubleToLongBits(other.y))141 return false;142 return true;143 }144 116 }
Note:
See TracChangeset
for help on using the changeset viewer.