Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.NameBean


    assertEquals(2, groups.size());

    StopGroupBean groupA = groups.get(0);
    StopGroupBean groupB = groups.get(1);

    NameBean nameA = groupA.getName();
    assertEquals("destination", nameA.getType());
    assertEquals("Destination A", nameA.getName());

    List<String> stopIdsA = groupA.getStopIds();
    assertEquals(3, stopIdsA.size());
    assertEquals(ids(stopA.getId(), stopB.getId(), stopC.getId()), stopIdsA);

    NameBean nameB = groupB.getName();
    assertEquals("destination", nameB.getType());
    assertEquals("Destination B", nameB.getName());

    List<String> stopIdsB = groupB.getStopIds();
    assertEquals(2, stopIdsB.size());
    assertEquals(ids(stopC.getId(), stopA.getId()), stopIdsB);
View Full Code Here


    List<StopSequenceCollection> blocks = _stopSequenceBlocksService.getStopSequencesAsCollections(sequences);

    for (StopSequenceCollection block : blocks) {

      NameBean name = new NameBean(NameBeanTypes.DESTINATION,
          block.getDescription());

      List<StopEntry> stops = getStopsInOrder(block);
      List<String> groupStopIds = new ArrayList<String>();
      for (StopEntry stop : stops)
View Full Code Here

      _value = "top";

    Object obj = findValue(_value);

    if (obj instanceof NameBean) {
      NameBean name = (NameBean) obj;
      String value = name.getName();
      try {
        if (value != null)
          writer.write(value);
      } catch (IOException e) {
        LOG.error("Could not write out Text tag", e);
View Full Code Here

    String[] tokens = name.split("\\s+&\\s+");
    List<NameBean> names = new ArrayList<NameBean>();

    if (tokens.length == 2) {
      names.add(new NameBean(SelectionNameTypes.MAIN_STREET, tokens[0]));
      names.add(new NameBean(SelectionNameTypes.CROSS_STREET, tokens[1]));

    } else {
      names.add(new NameBean(SelectionNameTypes.STOP_DESCRIPTION, name));
    }

    return names;
  }
View Full Code Here

      if (_splitStopNames) {
        List<NameBean> names = _locationNameSplitStrategy.splitLocationNameIntoParts(stop.getName());
        for (NameBean name : names)
          subTree = subTree.getSubTree(name);
      } else {
        NameBean name = new NameBean(SelectionNameTypes.STOP_NAME,
            stop.getName());
        subTree = subTree.getSubTree(name);
      }

      // As a last resort, we extend the tree by the stop number (guaranteed to
      // be unique)
      String code = stop.getCode() != null ? stop.getCode() : stop.getId();

      NameBean name = new NameBean(SelectionNameTypes.STOP_DESCRIPTION,
          "Stop # " + code);
      subTree = subTree.getSubTree(name);
      subTree.setStop(stop);
    }
  }
View Full Code Here

    Set<NameBean> names = tree.getNames();

    // If we've only got one name, short circuit
    if (names.size() == 1) {

      NameBean next = names.iterator().next();
      selection.addSelected(next);

      StopSelectionTreeBean subtree = tree.getSubTree(next);
      visitTree(subtree, selection, selectionIndices, index);
View Full Code Here

    if (tree.hasStop())
      return tree.getStop();

    if (tree.getNames().size() == 1) {
      NameBean next = tree.getNames().iterator().next();
      return getStop(tree.getSubTree(next));
    }

    return null;
  }
View Full Code Here

    } else {

      String key = addNavigationSelectionActionForIndex(navigation, index);

      NameBean name = names.get(index);
      handleName(name, key);

      addNavigateToAction(navigation, "4", first(index - 1));
      addNavigateToAction(navigation, "6", index + 1);
      addNavigateToAction(navigation, "7", first(index - 10));
View Full Code Here

TOP

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

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.