All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.transit.raptor.rangeraptor.standard.stoparrivals.view.Transfer Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
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());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy