// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/entities/LatLong.java
// @AutoValue public abstract class LatLong {
//   public abstract double latitude();
// 
//   public abstract double longitude();
// 
//   public abstract float altitude();
// 
//   public abstract boolean isCheckPoint();
// 
//   public static LatLong create(double latitude, double longitude) {
//     return create(latitude, longitude, 0, false);
//   }
// 
//   public static LatLong create(double latitude, double longitude, float altitude,
//       boolean isCheckPoint) {
//     return new AutoValue_LatLong(latitude, longitude, altitude, isCheckPoint);
//   }
// }
// 
// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/entities/LatLongDetailed.java
// @AutoValue public abstract class LatLongDetailed {
//   public abstract Location location();
// 
//   public abstract boolean isCheckPoint();
// 
//   public static LatLongDetailed create(Location location) {
//     return create(location, false);
//   }
// 
//   public static LatLongDetailed create(Location location, boolean isCheckPoint) {
//     return new AutoValue_LatLongDetailed(location, isCheckPoint);
//   }
// }
// 
// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/entities/RouteStats.java
// @AutoValue public abstract class RouteStats {
// 
//   public abstract long time();
// 
//   public abstract long distance();
// 
//   public abstract float speedMax();
// 
//   public abstract float speedMin();
// 
//   public abstract float speedAverage();
// 
//   public abstract float speed();
// 
//   public abstract LatLongDetailed currentLocation();
// 
//   public abstract List<LatLong> latLongs();
// 
//   public abstract List<LatLongDetailed> latLongsDetailed();
// 
//   public static RouteStats create(long time, long distance, float speedMax, float speedMin,
//       float speedAverage, float speed, LatLongDetailed currentLocation, List<LatLong> latLongs,
//       List<LatLongDetailed> latLongsDetailed) {
//     return new AutoValue_RouteStats(time, distance, speedMax, speedMin, speedAverage, speed,
//         currentLocation, latLongs, latLongsDetailed);
//   }
// 
//   public LatLong getLastLatLong() {
//     return latLongs() != null && !latLongs().isEmpty() ? latLongs().get(latLongs().size() - 1)
//         : LatLong.create(0, 0);
//   }
// 
//   public LatLongDetailed getLastLatLongDetailed() {
//     int size = latLongsDetailed().size();
//     return latLongsDetailed() != null && !latLongsDetailed().isEmpty() ? latLongsDetailed().get(
//         size - 1) : LatLongDetailed.create(new Location("Location-" + size));
//   }
// 
//   @Override public String toString() {
//     return " time="
//         + time()
//         + " distance="
//         + distance()
//         + " speed="
//         + speed()
//         + " latLong="
//         + "("
//         + currentLocation().location().getLatitude()
//         + ", "
//         + currentLocation().location().getLongitude()
//         + ") checkpoint="
//         + currentLocation().isCheckPoint()
//         + " waypoints="
//         + (latLongs() != null && !latLongs().isEmpty() ? latLongs().size()
//         : latLongsDetailed() != null && !latLongsDetailed().isEmpty() ? latLongsDetailed().size()
//             : 0);
//   }
// }


import rx.observables.ConnectableObservable;
import rx.subscriptions.CompositeSubscription;
import android.location.Location;
import android.util.Log;
import com.miguelbcr.io.rx_gps_service.lib.entities.LatLong;
import com.miguelbcr.io.rx_gps_service.lib.entities.LatLongDetailed;
import com.miguelbcr.io.rx_gps_service.lib.entities.RouteStats;
import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import rx.Subscription;
import rx.functions.Action1;
import rx.functions.Func1;
/*
 * Copyright 2016 miguelbcr
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.miguelbcr.io.rx_gps_service.lib;





class RxGpsPresenter {
  private static final String TAG = "RxGpsService";
  private final MeaningfulUpdatesLocation meaningfulUpdatesLocation;
  private final RecordTime recordTime;
  private final GetTripDistance getTripDistance;
  private final GetTripSpeed getTripSpeed;
  private final GetTripSpeedAverage getTripSpeedAverage;
  private final GetTripSpeedMax getTripSpeedMax;
  private final GetTripSpeedMin getTripSpeedMin;
  private final Utilities utilities;
  private final CompositeSubscription subscriptions;
  private ConnectableObservable<RouteStats> connectableObservable;
// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/entities/LatLong.java
// @AutoValue public abstract class LatLong {
//   public abstract double latitude();
// 
//   public abstract double longitude();
// 
//   public abstract float altitude();
// 
//   public abstract boolean isCheckPoint();
// 
//   public static LatLong create(double latitude, double longitude) {
//     return create(latitude, longitude, 0, false);
//   }
// 
//   public static LatLong create(double latitude, double longitude, float altitude,
//       boolean isCheckPoint) {
//     return new AutoValue_LatLong(latitude, longitude, altitude, isCheckPoint);
//   }
// }
// 
// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/entities/LatLongDetailed.java
// @AutoValue public abstract class LatLongDetailed {
//   public abstract Location location();
// 
//   public abstract boolean isCheckPoint();
// 
//   public static LatLongDetailed create(Location location) {
//     return create(location, false);
//   }
// 
//   public static LatLongDetailed create(Location location, boolean isCheckPoint) {
//     return new AutoValue_LatLongDetailed(location, isCheckPoint);
//   }
// }
// 
// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/entities/RouteStats.java
// @AutoValue public abstract class RouteStats {
// 
//   public abstract long time();
// 
//   public abstract long distance();
// 
//   public abstract float speedMax();
// 
//   public abstract float speedMin();
// 
//   public abstract float speedAverage();
// 
//   public abstract float speed();
// 
//   public abstract LatLongDetailed currentLocation();
// 
//   public abstract List<LatLong> latLongs();
// 
//   public abstract List<LatLongDetailed> latLongsDetailed();
// 
//   public static RouteStats create(long time, long distance, float speedMax, float speedMin,
//       float speedAverage, float speed, LatLongDetailed currentLocation, List<LatLong> latLongs,
//       List<LatLongDetailed> latLongsDetailed) {
//     return new AutoValue_RouteStats(time, distance, speedMax, speedMin, speedAverage, speed,
//         currentLocation, latLongs, latLongsDetailed);
//   }
// 
//   public LatLong getLastLatLong() {
//     return latLongs() != null && !latLongs().isEmpty() ? latLongs().get(latLongs().size() - 1)
//         : LatLong.create(0, 0);
//   }
// 
//   public LatLongDetailed getLastLatLongDetailed() {
//     int size = latLongsDetailed().size();
//     return latLongsDetailed() != null && !latLongsDetailed().isEmpty() ? latLongsDetailed().get(
//         size - 1) : LatLongDetailed.create(new Location("Location-" + size));
//   }
// 
//   @Override public String toString() {
//     return " time="
//         + time()
//         + " distance="
//         + distance()
//         + " speed="
//         + speed()
//         + " latLong="
//         + "("
//         + currentLocation().location().getLatitude()
//         + ", "
//         + currentLocation().location().getLongitude()
//         + ") checkpoint="
//         + currentLocation().isCheckPoint()
//         + " waypoints="
//         + (latLongs() != null && !latLongs().isEmpty() ? latLongs().size()
//         : latLongsDetailed() != null && !latLongsDetailed().isEmpty() ? latLongsDetailed().size()
//             : 0);
//   }
// }


// Path: lib/src/main/java/com/miguelbcr/io/rx_gps_service/lib/RxGpsPresenter.java
import rx.observables.ConnectableObservable;
import rx.subscriptions.CompositeSubscription;
import android.location.Location;
import android.util.Log;
import com.miguelbcr.io.rx_gps_service.lib.entities.LatLong;
import com.miguelbcr.io.rx_gps_service.lib.entities.LatLongDetailed;
import com.miguelbcr.io.rx_gps_service.lib.entities.RouteStats;
import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import rx.Subscription;
import rx.functions.Action1;
import rx.functions.Func1;

/*
 * Copyright 2016 miguelbcr
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.miguelbcr.io.rx_gps_service.lib;





class RxGpsPresenter {
  private static final String TAG = "RxGpsService";
  private final MeaningfulUpdatesLocation meaningfulUpdatesLocation;
  private final RecordTime recordTime;
  private final GetTripDistance getTripDistance;
  private final GetTripSpeed getTripSpeed;
  private final GetTripSpeedAverage getTripSpeedAverage;
  private final GetTripSpeedMax getTripSpeedMax;
  private final GetTripSpeedMin getTripSpeedMin;
  private final Utilities utilities;
  private final CompositeSubscription subscriptions;
  private ConnectableObservable<RouteStats> connectableObservable;
  private List<LatLong> latLongs;