Package org.onebusaway.uk.atoc.timetable_parser

Examples of org.onebusaway.uk.atoc.timetable_parser.StationElement


  private class MasterStationNameHandler extends DefaultContentHandler {

    @Override
    public void startElement(Element element) {
      if (element instanceof StationElement) {
        StationElement station = (StationElement) element;
        StationElement existing = _stationsByTiploc.put(station.getTiploc(),
            station);
        if (existing != null) {
          _log.warn("duplicate station tiploc=" + station.getTiploc());
        }
      }
View Full Code Here


        xTotal += stationLocation.getX();
        yTotal += stationLocation.getY();
        count++;
        continue;
      }
      StationElement stationElement = getStationForTiploc(tiploc);
      if (stationElement != null) {
        xTotal += stationElement.getEasting();
        yTotal += stationElement.getNorthing();
        count++;
        continue;
      }
    }
    if (count == 0) {
View Full Code Here

  private class MasterStationNameHandler extends DefaultContentHandler {

    @Override
    public void startElement(Element element) {
      if (element instanceof StationElement) {
        StationElement station = (StationElement) element;
        StationElement existing = _stationsByTiploc.put(station.getTiploc(),
            station);
        if (existing != null) {
          _log.warn("duplicate station tiploc=" + station.getTiploc());
        }
      }
View Full Code Here

  }

  private void updateRangeForStanox(int stanox, Range x, Range y) {
    Set<String> tiplocs = _timetableService.getTiplocsForStanox(stanox);
    for (String tiploc : tiplocs) {
      StationElement station = _timetableService.getStationForTiploc(tiploc);
      if (station == null) {
        continue;
      }
      x.addValue(station.getEasting());
      y.addValue(station.getNorthing());
    }
  }
View Full Code Here

    double xTotal = 0;
    double yTotal = 0;
    int count = 0;

    for (String tiploc : _timetableService.getTiplocsForStanox(stanox)) {
      StationElement station = _timetableService.getStationForTiploc(tiploc);
      if (station != null) {
        xTotal += station.getEasting();
        yTotal += station.getNorthing();
        count++;
      }
    }

    if (count == 0) {
View Full Code Here

      if (style == null) {
        style = IconStyles.SMALL[regionToStyle.size() % IconStyles.SMALL.length];
        regionToStyle.put(region, style);
      }
      for (String tiploc : model.getTiplocsForStanox(stanox)) {
        StationElement station = model.getStationForTiploc(tiploc);
        if (station != null) {
          writer.println(region + "," + style + "," + stanox + "," + tiploc
              + "," + station.getLat() + "," + station.getLon() + ","
              + station.getName());
        }
      }
    }

    writer.close();
View Full Code Here

      }
      Range xRange = ranges.getFirst();
      Range yRange = ranges.getSecond();
       
      for (String tiploc : model.getTiplocsForStanox(stanox)) {
        StationElement station = model.getStationForTiploc(tiploc);
        if (station != null) {
          writer.println(area + "," + style + "," + from + "," + to + ","
              + region + "," + stanox + "," + tiploc + "," + station.getLat()
              + "," + station.getLon() + "," + station.getName());
          xRange.addValue(station.getEasting());
          yRange.addValue(station.getNorthing());
        }
      }
    }
   
    Max<String> maxRange = new Max<String>();
View Full Code Here

      if (tiplocs == null) {
        noTiplocs++;
        continue;
      }
      for (String tiploc : tiplocs) {
        StationElement station = _stationsByTiploc.get(tiploc);
        if (station == null) {
          noStation++;
          continue;
        }
        System.out.println(area + "," + stanox + "," + tiploc + ","
            + station.getLat() + "," + station.getLon());
        total++;
      }
    }

    System.out.println("emptyStanox=" + emptyStanox);
View Full Code Here

  private class MasterStationNameHandler extends DefaultContentHandler {

    @Override
    public void startElement(Element element) {
      if (element instanceof StationElement) {
        StationElement station = (StationElement) element;
        _stationsByTiploc.put(station.getTiploc(), station);
      }
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.uk.atoc.timetable_parser.StationElement

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.