Package org.onebusaway.api.model.transit.tripplanning

Examples of org.onebusaway.api.model.transit.tripplanning.VertexV2Bean


    GraphResultV2Bean result = new GraphResultV2Bean();

    List<VertexV2Bean> vertices = new ArrayList<VertexV2Bean>();

    for (VertexBean vertex : list) {
      VertexV2Bean bean = new VertexV2Bean();
      bean.setId(vertex.getId());
      bean.setLocation(vertex.getLocation());

      Map<String, String> tags = getTags(vertex.getTags());

      bean.setTags(tags);
      vertices.add(bean);
    }

    if (!vertices.isEmpty())
      result.setVertices(vertices);

    List<EdgeV2Bean> edges = new ArrayList<EdgeV2Bean>();

    for (VertexBean vertex : list) {
      List<EdgeNarrativeBean> out = vertex.getOutgoing();
      if (out != null) {
        for (EdgeNarrativeBean narrative : out) {
          EdgeV2Bean bean = new EdgeV2Bean();
          bean.setFromId(narrative.getFrom().getId());
          bean.setToId(narrative.getTo().getId());
          bean.setName(narrative.getName());
          bean.setPath(narrative.getPath());
          Map<String, String> tags = getTags(narrative.getTags());
          bean.setTags(tags);

          edges.add(bean);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.api.model.transit.tripplanning.VertexV2Bean

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.