Changes in / [6162:6168] in josm
- Location:
- /trunk/src/org/openstreetmap/josm/data
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
/trunk/src/org/openstreetmap/josm/data/Preferences.java
r6162 r6168 963 963 List<List<String>> prop = arrayProperties.get(key); 964 964 if (prop != null) { 965 @SuppressWarnings("unchecked") 965 @SuppressWarnings({ "unchecked", "rawtypes" }) 966 966 Collection<Collection<String>> prop_cast = (Collection) prop; 967 967 return prop_cast; … … 974 974 List<List<String>> prop = arrayProperties.get(key); 975 975 if (prop != null) { 976 @SuppressWarnings("unchecked") 976 @SuppressWarnings({ "unchecked", "rawtypes" }) 977 977 Collection<Collection<String>> prop_cast = (Collection) prop; 978 978 return prop_cast; … … 982 982 983 983 public boolean putArray(String key, Collection<Collection<String>> value) { 984 boolean changed = false; 984 //boolean changed = false; 985 985 986 986 List<List<String>> oldValue = null; -
/trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
r6162 r6168 14 14 * EastNorth. 15 15 * 16 * @ author imi16 * @since 6162 17 17 */ 18 abstract class Coordinate implements Serializable { 18 abstract class Coordinate implements Cloneable, Serializable { 19 19 20 20 protected final double x; … … 39 39 } 40 40 41 /** 42 * Returns the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate}. 43 * 44 * @param coor the specified coordinate to be measured against this {@code Coordinate} 45 * @return the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate} 46 * @since 6166 47 */ 48 protected final double distance(final Coordinate coor) { 49 return distance(coor.x, coor.y); 50 } 51 52 /** 53 * Returns the euclidean distance from this {@code Coordinate} to a specified coordinate. 54 * 55 * @param px the X coordinate of the specified point to be measured against this {@code Coordinate} 56 * @param py the Y coordinate of the specified point to be measured against this {@code Coordinate} 57 * @return the euclidean distance from this {@code Coordinate} to a specified coordinate 58 * @since 6166 59 */ 60 public final double distance(final double px, final double py) { 61 final double dx = this.x-px; 62 final double dy = this.y-py; 63 return Math.sqrt(dx*dx + dy*dy); 64 } 65 66 /** 67 * Returns the square of the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate}. 68 * 69 * @param coor the specified coordinate to be measured against this {@code Coordinate} 70 * @return the square of the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate} 71 * @since 6166 72 */ 73 protected final double distanceSq(final Coordinate coor) { 74 return distanceSq(coor.x, coor.y); 75 } 76 77 /** 78 * Returns the square of euclidean distance from this {@code Coordinate} to a specified coordinate. 79 * 80 * @param px the X coordinate of the specified point to be measured against this {@code Coordinate} 81 * @param py the Y coordinate of the specified point to be measured against this {@code Coordinate} 82 * @return the square of the euclidean distance from this {@code Coordinate} to a specified coordinate 83 * @since 6166 84 */ 85 public final double distanceSq(final double px, final double py) { 86 final double dx = this.x-px; 87 final double dy = this.y-py; 88 return dx*dx + dy*dy; 89 } 90 41 91 @Override 42 92 public int hashCode() { … … 55 105 if (this == obj) 56 106 return true; 57 if (!super.equals(obj))58 return false;59 107 if (getClass() != obj.getClass()) 60 108 return false; -
/trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
r6162 r6168 45 45 46 46 /** 47 * Countseuclidean distancebetween this and otherEastNorth.47 * Returns the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth}. 48 48 * 49 * @param en2 other EastNorth 50 * @return distance between this and other EastNorth 49 * @param en the specified coordinate to be measured against this {@code EastNorth} 50 * @return the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth} 51 * @since 6166 51 52 */ 52 public double distance(final EastNorth en2) { 53 final double dx = this.x-en2.x; 54 final double dy = this.y-en2.y; 55 return Math.sqrt(dx*dx + dy*dy); 53 public double distance(final EastNorth en) { 54 return super.distance(en); 56 55 } 57 56 58 57 /** 59 * Countssquare of euclidean distancebetween this and otherEastNorth.58 * Returns the square of the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth}. 60 59 * 61 * @param en2 other EastNorth 62 * @return square of distance between this and other EastNorth 60 * @param en the specified coordinate to be measured against this {@code EastNorth} 61 * @return the square of the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth} 62 * @since 6166 63 63 */ 64 public double distanceSq(final EastNorth en2) { 65 final double dx = this.x-en2.x; 66 final double dy = this.y-en2.y; 67 return dx*dx + dy*dy; 64 public double distanceSq(final EastNorth en) { 65 return super.distanceSq(en); 68 66 } 69 67 … … 132 130 return (Math.abs(x - other.x) < e && Math.abs(y - other.y) < e); 133 131 } 132 133 @Override 134 public EastNorth clone() { 135 return new EastNorth(x, y); 136 } 134 137 } -
/trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r6162 r6168 27 27 */ 28 28 public class LatLon extends Coordinate { 29 30 29 31 30 /** … … 298 297 299 298 /** 300 * Countseuclidean distancebetween this and otherLatLon.299 * Returns the euclidean distance from this {@code LatLon} to a specified {@code LatLon}. 301 300 * 302 * @param ll2 other LatLon 303 * @return distance between this and other LatLon 304 */ 305 public double distance(final LatLon ll2) { 306 final double dx = this.x-ll2.x; 307 final double dy = this.y-ll2.y; 308 return Math.sqrt(dx*dx + dy*dy); 309 } 310 301 * @param ll the specified coordinate to be measured against this {@code LatLon} 302 * @return the euclidean distance from this {@code LatLon} to a specified {@code LatLon} 303 * @since 6166 304 */ 305 public double distance(final LatLon ll) { 306 return super.distance(ll); 307 } 308 309 /** 310 * Returns the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon}. 311 * 312 * @param ll the specified coordinate to be measured against this {@code LatLon} 313 * @return the square of the euclidean distance from this {@code LatLon} to a specified {@code LatLon} 314 * @since 6166 315 */ 316 public double distanceSq(final LatLon ll) { 317 return super.distanceSq(ll); 318 } 319 311 320 @Override public String toString() { 312 321 return "LatLon[lat="+lat()+",lon="+lon()+"]"; … … 386 395 return true; 387 396 } 397 398 @Override 399 public LatLon clone() { 400 return new LatLon(x, y); 401 } 388 402 }
Note:
See TracChangeset
for help on using the changeset viewer.