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

org.opentripplanner.transit.raptor.rangeraptor.multicriteria.arrivals.TransitStopArrival Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.transit.raptor.rangeraptor.multicriteria.arrivals;


import org.opentripplanner.transit.raptor.api.transit.RaptorTripSchedule;
import org.opentripplanner.transit.raptor.api.view.TransitLegView;

/**
 *
 * @param  The TripSchedule type defined by the user of the raptor API.
 */
public final class TransitStopArrival
    extends AbstractStopArrival
    implements TransitLegView
{
    private final T trip;

    public TransitStopArrival(
        AbstractStopArrival previousState,
        int stopIndex,
        int arrivalTime,
        int additionalCost,
        T trip
    ) {
        super(
                previousState,
                stopIndex,
                arrivalTime,
                additionalCost
        );
        this.trip = trip;
    }

    @Override
    public boolean arrivedByTransit() {
        return true;
    }

    @Override
    public TransitLegView transitLeg() {
        return this;
    }

    public T trip() {
        return trip;
    }

    public int boardStop() {
        return previousStop();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy