Search in sources :

Example 1 with ServiceIdKey

use of org.onebusaway.gtfs_transformer.collections.ServiceIdKey in project onebusaway-gtfs-modules by OneBusAway.

the class EntityRetentionGraph method retainTrip.

private void retainTrip(Trip trip, boolean retainUp) {
    if (retainUp) {
        for (StopTime stopTime : _dao.getStopTimesForTrip(trip)) retainUp(stopTime);
        if (_retainBlocks && trip.getBlockId() != null) {
            AgencyAndId blockId = new AgencyAndId(trip.getId().getAgencyId(), trip.getBlockId());
            retainUp(new BlockIdKey(blockId));
        }
        for (Frequency frequency : _dao.getFrequenciesForTrip(trip)) retainUp(frequency);
    } else {
        retainDown(trip.getRoute());
        retainDown(new ServiceIdKey(trip.getServiceId()));
        AgencyAndId shapeId = trip.getShapeId();
        if (shapeId != null && shapeId.hasValues())
            retainDown(new ShapeIdKey(shapeId));
    }
}
Also used : AgencyAndId(org.onebusaway.gtfs.model.AgencyAndId) ShapeIdKey(org.onebusaway.gtfs_transformer.collections.ShapeIdKey) Frequency(org.onebusaway.gtfs.model.Frequency) ServiceIdKey(org.onebusaway.gtfs_transformer.collections.ServiceIdKey) StopTime(org.onebusaway.gtfs.model.StopTime)

Aggregations

AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)1 Frequency (org.onebusaway.gtfs.model.Frequency)1 StopTime (org.onebusaway.gtfs.model.StopTime)1 ServiceIdKey (org.onebusaway.gtfs_transformer.collections.ServiceIdKey)1 ShapeIdKey (org.onebusaway.gtfs_transformer.collections.ShapeIdKey)1