Changeset 13602 in josm for trunk/src/org/openstreetmap/josm/data/Bounds.java
- Timestamp:
- 2018-04-07T20:42:34+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Bounds.java
r13173 r13602 355 355 public String toShortString(DecimalFormat format) { 356 356 return format.format(minLat) + ' ' 357 + format.format(minLon) + " / "358 + format.format(maxLat) + ' '359 + format.format(maxLon);357 + format.format(minLon) + " / " 358 + format.format(maxLat) + ' ' 359 + format.format(maxLon); 360 360 } 361 361 … … 513 513 */ 514 514 public double getArea() { 515 double w = getWidth(); 516 return w * (maxLat - minLat); 515 return getWidth() * (maxLat - minLat); 517 516 } 518 517 … … 523 522 */ 524 523 public String encodeAsString(String separator) { 525 StringBuilder sb = new StringBuilder(); 526 sb.append(minLat).append(separator).append(minLon) 527 .append(separator).append(maxLat).append(separator) 528 .append(maxLon); 529 return sb.toString(); 524 return new StringBuilder() 525 .append(minLat).append(separator).append(minLon).append(separator) 526 .append(maxLat).append(separator).append(maxLon).toString(); 530 527 } 531 528 … … 574 571 Bounds bounds = (Bounds) obj; 575 572 return Double.compare(bounds.minLat, minLat) == 0 && 576 577 578 573 Double.compare(bounds.minLon, minLon) == 0 && 574 Double.compare(bounds.maxLat, maxLat) == 0 && 575 Double.compare(bounds.maxLon, maxLon) == 0; 579 576 } 580 577 }
Note:
See TracChangeset
for help on using the changeset viewer.