mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-04 11:23:50 +00:00
Merge branch 'placemark' into spectator
Conflicts: java/com.sap.sailing.domain.common/src/com/sap/sailing/domain/common/impl/SerializablePositionImpl.java
This commit is contained in:
commit
5ea3e15823
6 files changed
+36
-27
No files matched your search
+1
-1
@@ -50,7 +50,7 @@ public abstract class AbstractBearing implements Bearing {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int) (1023 ^ Double.doubleToLongBits(getDegrees()));
|
||||
return 1023 ^ (int) getDegrees();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public abstract class AbstractSpeedImpl implements Speed {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int) (31 * Double.doubleToLongBits(getMetersPerSecond()));
|
||||
return 31 * (int) getMetersPerSecond();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-5
@@ -1,7 +1,5 @@
|
||||
package com.sap.sailing.domain.common.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.common.CountryCodeFactory;
|
||||
import com.sap.sailing.domain.common.Distance;
|
||||
import com.sap.sailing.domain.common.Placemark;
|
||||
@@ -14,7 +12,7 @@ import com.sap.sailing.domain.common.SerializablePosition;
|
||||
* @author Lennart Hensler (D054527)
|
||||
*
|
||||
*/
|
||||
public class PlacemarkImpl implements Placemark, Serializable {
|
||||
public class PlacemarkImpl implements Placemark {
|
||||
private static final long serialVersionUID = -7287453946921815463L;
|
||||
|
||||
private String name;
|
||||
@@ -75,11 +73,12 @@ public class PlacemarkImpl implements Placemark, Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder(Placemark.class.getSimpleName() + "[");
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
||||
b.append(name + ", ");
|
||||
b.append(countryCode + ", ");
|
||||
b.append(position.toString() + ", ");
|
||||
b.append(population + "]");
|
||||
b.append(population);
|
||||
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
+14
-14
@@ -23,20 +23,20 @@ public class RacePlaceOrderImpl implements RacePlaceOrder, Serializable {
|
||||
return Collections.unmodifiableCollection(places);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
boolean first = true;
|
||||
for (Placemark place : places) {
|
||||
if (first) {
|
||||
b.append(place.getCountryCode() + ", " + place.getName());
|
||||
first = false;
|
||||
} else {
|
||||
b.append(" -> " + place.getCountryCode() + ", " + place.getName());
|
||||
}
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
// @Override
|
||||
// public String toString() {
|
||||
// StringBuilder b = new StringBuilder();
|
||||
// boolean first = true;
|
||||
// for (Placemark place : places) {
|
||||
// if (first) {
|
||||
// b.append(place.getCountryCode() + ", " + place.getName());
|
||||
// first = false;
|
||||
// } else {
|
||||
// b.append(" -> " + place.getCountryCode() + ", " + place.getName());
|
||||
// }
|
||||
// }
|
||||
// return b.toString();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
+14
-4
@@ -1,11 +1,9 @@
|
||||
package com.sap.sailing.domain.common.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.SerializablePosition;
|
||||
|
||||
public class SerializablePositionImpl implements SerializablePosition, Serializable {
|
||||
public class SerializablePositionImpl implements SerializablePosition {
|
||||
private static final long serialVersionUID = -5649921262460723024L;
|
||||
|
||||
private double latDeg;
|
||||
@@ -14,7 +12,6 @@ public class SerializablePositionImpl implements SerializablePosition, Serializa
|
||||
SerializablePositionImpl() {}
|
||||
|
||||
public SerializablePositionImpl(double latDeg, double lngDeg) {
|
||||
super();
|
||||
this.latDeg = latDeg;
|
||||
this.lngDeg = lngDeg;
|
||||
}
|
||||
@@ -33,9 +30,16 @@ public class SerializablePositionImpl implements SerializablePosition, Serializa
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
<<<<<<< HEAD
|
||||
int temp = (int) latDeg;
|
||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||
temp = (int) lngDeg;
|
||||
=======
|
||||
long temp;
|
||||
temp = (int) latDeg;
|
||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||
temp = (int) latDeg;
|
||||
>>>>>>> placemark
|
||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||
return result;
|
||||
}
|
||||
@@ -49,9 +53,15 @@ public class SerializablePositionImpl implements SerializablePosition, Serializa
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
SerializablePositionImpl other = (SerializablePositionImpl) obj;
|
||||
<<<<<<< HEAD
|
||||
if (new Double(latDeg).equals(other.latDeg))
|
||||
return false;
|
||||
if (new Double(lngDeg).equals(other.lngDeg))
|
||||
=======
|
||||
if (!new Double(latDeg).equals(other.latDeg))
|
||||
return false;
|
||||
if (!new Double(lngDeg).equals(other.lngDeg))
|
||||
>>>>>>> placemark
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -190,8 +190,8 @@ public class ReverseGeocoderImpl implements ReverseGeocoder {
|
||||
* The results of the search
|
||||
*/
|
||||
private void cachePlacemarks(Position position, Double radius, List<Placemark> placemarks) {
|
||||
Collections.sort(placemarks, new Placemark.ByDistance(position));
|
||||
cache.put(position, new Triple<Position, Double, List<Placemark>>(position, radius, placemarks));
|
||||
// Collections.sort(placemarks, new Placemark.ByDistance(position));
|
||||
// cache.put(position, new Triple<Position, Double, List<Placemark>>(position, radius, placemarks));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user