org.onebusaway.gtfs.services.GtfsRelationalDao Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of onebusaway-gtfs Show documentation
Show all versions of onebusaway-gtfs Show documentation
A Java library for reading and writing General Transit Feed Spec feeds
/**
* Copyright (C) 2011 Brian Ferris
* Copyright (C) 2011 Google, Inc.
* Copyright (C) 2011 Laurent Gregoire
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onebusaway.gtfs.services;
import org.onebusaway.gtfs.model.Agency;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.FareAttribute;
import org.onebusaway.gtfs.model.FareRule;
import org.onebusaway.gtfs.model.Frequency;
import org.onebusaway.gtfs.model.Route;
import org.onebusaway.gtfs.model.ServiceCalendar;
import org.onebusaway.gtfs.model.ServiceCalendarDate;
import org.onebusaway.gtfs.model.ShapePoint;
import org.onebusaway.gtfs.model.Stop;
import org.onebusaway.gtfs.model.StopTime;
import org.onebusaway.gtfs.model.Trip;
import java.util.List;
/**
* While {@link GtfsDao} has basic methods for retrieving collections of
* entities and entities by id, {@link GtfsRelationalDao} adds some basic
* methods for retrieving entities using more complex data relations.
*
* You can imagine many complex queries that you might perform on GTFS data,
* most of which will not be included here. These are just some basic relational
* methods that we use to bootstrap other GTFS classes. To add more complex
* queries, look at the specific mechanisms provided by classes implementing
* {@link GtfsRelationalDao} and {@link GtfsDao}.
*
* @author bdferris
*/
public interface GtfsRelationalDao extends GtfsDao {
/****
* ServiceId Methods
****/
public List getTripAgencyIdsReferencingServiceId(AgencyAndId serviceId);
/****
* Route Methods
****/
public List getRoutesForAgency(Agency agency);
/****
* Stop Methods
****/
public List getStopsForStation(Stop station);
/****
* {@link Trip} Methods
****/
public List getTripsForRoute(Route route);
public List getTripsForBlockId(AgencyAndId blockId);
/****
* {@link StopTime} Methods
****/
/**
* @return the list of {@link StopTime} objects associated with the trip,
* sorted by {@link StopTime#getStopSequence()}
*/
public List getStopTimesForTrip(Trip trip);
/**
* @return the list of {@link StopTime} objects associated with the specified
* {@link Stop}, in no particular order
*/
public List getStopTimesForStop(Stop stop);
/****
* {@link ShapePoint} Methods
****/
public List getAllShapeIds();
public List getShapePointsForShapeId(AgencyAndId shapeId);
/****
* {@link Frequency} Methods
****/
public List getFrequenciesForTrip(Trip trip);
/****
* {@link ServiceCalendar} Methods
****/
public ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId);
/****
* {@link ServiceCalendarDate} Methods
****/
public List getCalendarDatesForServiceId(AgencyAndId serviceId);
/****
* {@link FareRule}
*****/
public List getFareRulesForFareAttribute(FareAttribute fareAttribute);
}