本文整理汇总了Java中org.onebusaway.gtfs.model.Trip.getShapeId方法的典型用法代码示例。如果您正苦于以下问题:Java Trip.getShapeId方法的具体用法?Java Trip.getShapeId怎么用?Java Trip.getShapeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onebusaway.gtfs.model.Trip
的用法示例。
在下文中一共展示了Trip.getShapeId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getShapesForAgency
import org.onebusaway.gtfs.model.Trip; //导入方法依赖的package包/类
public Collection<AgencyAndId> getShapesForAgency(Agency agency) {
Set<AgencyAndId> agencyShapes = new HashSet<>();
for (Route r : dao.getRoutesForAgency(agency)) {
for (Trip t : dao.getTripsForRoute(r)) {
AgencyAndId shapeId = t.getShapeId();
if (shapeId != null) {
agencyShapes.add(shapeId);
}
}
}
return agencyShapes;
}
示例2: getShapesForRoute
import org.onebusaway.gtfs.model.Trip; //导入方法依赖的package包/类
public Collection<AgencyAndId> getShapesForRoute(Route route) {
Set<AgencyAndId> shapesForRoute = new HashSet<>();
for (Trip t : dao.getTripsForRoute(route)) {
if (t.getShapeId() != null) {
shapesForRoute.add(t.getShapeId());
}
}
return shapesForRoute;
}
示例3: getShapeForTrip
import org.onebusaway.gtfs.model.Trip; //导入方法依赖的package包/类
public Collection<AgencyAndId> getShapeForTrip(Trip trip) {
AgencyAndId shapeId = trip.getShapeId();
if (shapeId != null) {
return Collections.singleton(shapeId);
} else {
return Collections.EMPTY_LIST;
}
}
示例4: getTripsForRouteAndShape
import org.onebusaway.gtfs.model.Trip; //导入方法依赖的package包/类
public Collection<Trip> getTripsForRouteAndShape(Route route, AgencyAndId shape) {
Collection<Trip> tripsForRoute = dao.getTripsForRoute(route);
List<Trip> tripsForRouteAndShape = new ArrayList<>(tripsForRoute.size());
for (Trip t : tripsForRoute) {
if (t.getShapeId() != null && t.getShapeId().equals(shape)) {
tripsForRouteAndShape.add(t);
}
}
return tripsForRouteAndShape;
}