public void ariveAtStop() throws NoGPSFixException { if (currentStop != null) departStopStop(0, 0); if (lastLocation != null) { currentStop = new RouteStop(); currentStop.arrivalTime = SystemClock.elapsedRealtime(); currentStop.location = lastLocation; } else throw new NoGPSFixException(); }
public void departStopStop(int board, int alight) throws NoGPSFixException { if (lastLocation != null) { if (currentStop == null) { currentStop = new RouteStop(); currentStop.arrivalTime = SystemClock.elapsedRealtime(); currentStop.location = lastLocation; } currentStop.alight = alight; currentStop.board = board; currentStop.departureTime = SystemClock.elapsedRealtime(); currentCapture.stops.add(currentStop); currentStop = null; } else throw new NoGPSFixException(); }