Changeset 2457 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-11-15T11:43:04+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r2332 r2457 28 28 * Replies true if lat is in the range [-90,90] 29 29 * 30 * @param lat the latitude 30 * @param lat the latitude 31 31 * @return true if lat is in the range [-90,90] 32 32 */ … … 38 38 * Replies true if lon is in the range [-180,180] 39 39 * 40 * @param lon the longitude 40 * @param lon the longitude 41 41 * @return true if lon is in the range [-180,180] 42 42 */ … … 44 44 return lon >= -180d && lon <= 180d; 45 45 } 46 46 47 47 public static String dms(double pCoordinate) { 48 48 … … 73 73 case DECIMAL_DEGREES: return cDdFormatter.format(y); 74 74 case DEGREES_MINUTES_SECONDS: return dms(y) + ((y < 0) ? 75 /* short symbol for South */ tr("S") :76 /* short symbol for North */ tr("N"));75 /* short symbol for South */ tr("S") : 76 /* short symbol for North */ tr("N")); 77 77 default: return "ERR"; 78 78 } … … 87 87 case DECIMAL_DEGREES: return cDdFormatter.format(x); 88 88 case DEGREES_MINUTES_SECONDS: return dms(x) + ((x < 0) ? 89 /* short symbol for West */ tr("W") :90 /* short symbol for East */ tr("E"));89 /* short symbol for West */ tr("W") : 90 /* short symbol for East */ tr("E")); 91 91 default: return "ERR"; 92 92 } … … 179 179 return "LatLon[lat="+lat()+",lon="+lon()+"]"; 180 180 } 181 182 @Override 183 public int hashCode() { 184 final int prime = 31; 185 int result = super.hashCode(); 186 long temp; 187 temp = java.lang.Double.doubleToLongBits(x); 188 result = prime * result + (int) (temp ^ (temp >>> 32)); 189 temp = java.lang.Double.doubleToLongBits(y); 190 result = prime * result + (int) (temp ^ (temp >>> 32)); 191 return result; 192 } 193 194 @Override 195 public boolean equals(Object obj) { 196 if (this == obj) 197 return true; 198 if (!super.equals(obj)) 199 return false; 200 if (getClass() != obj.getClass()) 201 return false; 202 Coordinate other = (Coordinate) obj; 203 if (java.lang.Double.doubleToLongBits(x) != java.lang.Double.doubleToLongBits(other.x)) 204 return false; 205 if (java.lang.Double.doubleToLongBits(y) != java.lang.Double.doubleToLongBits(other.y)) 206 return false; 207 return true; 208 } 181 209 }
Note:
See TracChangeset
for help on using the changeset viewer.