org.opentripplanner.transit.raptor.rangeraptor.standard.stoparrivals.view.Transfer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.transit.raptor.rangeraptor.standard.stoparrivals.view;
import org.opentripplanner.transit.raptor.api.transit.RaptorTripSchedule;
import org.opentripplanner.transit.raptor.api.view.ArrivalView;
import org.opentripplanner.transit.raptor.api.view.TransferLegView;
import org.opentripplanner.transit.raptor.rangeraptor.standard.stoparrivals.StopArrivalState;
final class Transfer
extends StopArrivalViewAdapter
implements TransferLegView
{
private final StopArrivalState arrival;
private final StopsCursor cursor;
Transfer(int round, int stop, StopArrivalState arrival, StopsCursor cursor) {
super(round, stop);
this.arrival = arrival;
this.cursor = cursor;
}
@Override
public int arrivalTime() {
return arrival.time();
}
@Override
public boolean arrivedByTransfer() {
return true;
}
@Override
public TransferLegView transferLeg() {
return this;
}
@Override
public int durationInSeconds() {
return arrival.transferDuration();
}
@Override
public ArrivalView previous() {
return cursor.transit(round(), arrival.transferFromStop());
}
}