Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.StopGroupingBean


    assertEquals(1, polylines.size());
    assertSame(polyline, polylines.get(0));

    List<StopGroupingBean> groupings = stopsForRoute.getStopGroupings();
    assertEquals(1, groupings.size());
    StopGroupingBean grouping = groupings.get(0);
    assertEquals("direction", grouping.getType());

    List<StopGroupBean> groups = grouping.getStopGroups();
    assertEquals(2, groups.size());

    StopGroupBean groupA = groups.get(0);
    StopGroupBean groupB = groups.get(1);
View Full Code Here


    result.setRoute(getRouteBeanForRouteCollection(routeCollectionId, narrative));
    result.setStops(getStopBeansForRoute(routeCollectionId));

    result.setPolylines(getEncodedPolylinesForRoute(routeCollection));

    StopGroupingBean directionGrouping = new StopGroupingBean();
    directionGrouping.setType(TransitDataConstants.STOP_GROUPING_TYPE_DIRECTION);
    List<StopGroupBean> directionGroups = new ArrayList<StopGroupBean>();
    directionGrouping.setStopGroups(directionGroups);
    directionGrouping.setOrdered(true);
    result.addGrouping(directionGrouping);

    List<BlockTripIndex> blockIndices = _blockIndexService.getBlockTripIndicesForRouteCollectionId(routeCollectionId);
    List<FrequencyBlockTripIndex> frequencyBlockIndices = _blockIndexService.getFrequencyBlockTripIndicesForRouteCollectionId(routeCollectionId);
View Full Code Here

  private StopSelectionTreeBean getStopsForRouteAsStopSelectionTree(
      StopsForRouteBean stopsForRoute) {

    StopSelectionTreeBean tree = new StopSelectionTreeBean();

    StopGroupingBean byDirection = getGroupingByType(stopsForRoute,
        TransitDataConstants.STOP_GROUPING_TYPE_DIRECTION);

    Map<String, StopBean> stopsById = getStopsById(stopsForRoute);

    if (byDirection != null) {
View Full Code Here

    _route = _transitDataService.getRouteForId(_id);
    StopsForRouteBean stopsForRoute = _transitDataService.getStopsForRoute(_id);

    Map<String, StopGroupingBean> groupingsByType = MappingLibrary.mapToValue(
        stopsForRoute.getStopGroupings(), "type", String.class);
    StopGroupingBean byDirection = groupingsByType.get(TransitDataConstants.STOP_GROUPING_TYPE_DIRECTION);

    if (_groupIndex == -1) {
      if (byDirection != null) {
        for (StopGroupBean group : byDirection.getStopGroups())
          _directionNames.add(group.getName());
      }
      _stops = stopsForRoute.getStops();
      Collections.sort(_stops, _stopNameComparator);
    } else {
      if (byDirection == null)
        return INPUT;
      List<StopGroupBean> groups = byDirection.getStopGroups();
      if (_groupIndex < 0 && groups.size() <= _groupIndex)
        return INPUT;
      Map<String, StopBean> stopById = MappingLibrary.mapToValue(
          stopsForRoute.getStops(), "id", String.class);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.StopGroupingBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.