MLocation extends Measurement implements Comparable<MLocation> { @NonNull @Override public String toRow() { final StringBuilder sb = new StringBuilder(); sb.append(millis); sb.append(",,gps,,"); sb.append(Numbers.format6.format(latitude)); sb.append(','); sb.append(Numbers.format6.format(longitude)); sb.append(','); sb.append(Numbers.format3.format(altitude_gps)); sb.append(','); if (Numbers.isReal(vN)) { sb.append(Numbers.format2.format(vN)); } sb.append(','); if (Numbers.isReal(vE)) { sb.append(Numbers.format2.format(vE)); } sb.append(','); if (satellitesUsed != -1) { sb.append(satellitesUsed); } return sb.toString(); } MLocation(long millis, double latitude, double longitude, double altitude_gps,
                     double climb, // Usually taken from altimeter
                     double vN, double vE,
                     float hAcc, float pdop, float hdop, float vdop,
                     int satellitesUsed, int satellitesInView);  MLocation(); @NonNull @Override String toRow(); @NonNull @Override String toString(); double groundSpeed(); double totalSpeed(); double glideRatio(); double glideAngle(); double bearing(); @NonNull LatLng latLng(); double bearingTo(@NonNull MLocation dest); double bearingTo(@NonNull LatLng dest); double distanceTo(@NonNull MLocation dest); double distanceTo(@NonNull LatLng dest); @NonNull LatLng moveDirection(double bearing, double distance); @Override int compareTo(@NonNull MLocation loc); boolean equals(@NonNull MLocation loc); final double latitude; final double longitude; final double altitude_gps; public float hAcc; final float pdop; final float hdop; final float vdop; final int satellitesUsed; final int satellitesInView; final double climb; }
@Test public void toRow() { assertEquals("1541348400990,,gps,,47.6,-122.33,100,3,4,0", seattle.toRow()); }