Package org.onebusaway.uk.network_rail.cif

Examples of org.onebusaway.uk.network_rail.cif.TiplocInsertElement


  private class ScheduleHandler extends DefaultContentHandler {

    @Override
    public void endElement(Element element) {
      if (element instanceof TiplocInsertElement) {
        TiplocInsertElement insert = (TiplocInsertElement) element;
        TiplocInsertElement existing = _insertsByTiploc.put(insert.getTiploc(),
            insert);
        if (existing != null) {
          _log.warn("duplicate insert tiploc=" + insert.getTiploc());
        }
      }
View Full Code Here


  private class ScheduleHandler extends DefaultContentHandler {

    @Override
    public void endElement(Element element) {
      if (element instanceof TiplocInsertElement) {
        TiplocInsertElement insert = (TiplocInsertElement) element;
        if (insert.getStanox() == 0) {
          return;
        }
        _stanoxByTiplocs.put(insert.getTiploc(), insert.getStanox());
        Set<String> tiplocs = _tiplocsByStanox.get(insert.getStanox());
        if (tiplocs == null) {
          tiplocs = new HashSet<String>();
          _tiplocsByStanox.put(insert.getStanox(), tiplocs);
        }
        tiplocs.add(insert.getTiploc());
      }
      if (element instanceof BasicScheduleElement) {
        BasicScheduleElement schedule = (BasicScheduleElement) element;
        if (!_schedulesByTrainUid.containsKey(schedule.getTrainUid())) {
          _schedulesByTrainUid.put(schedule.getTrainUid(), schedule);
View Full Code Here

  }

  private void fillTimepointsForTrainInstance(TrainInstance instance) {
    BasicScheduleElement schedule = instance.getSchedule();
    for (TimepointElement timepoint : schedule.getTimepoints()) {
      TiplocInsertElement insert = _insertsByTiploc.get(timepoint.getTiploc());
      if (insert == null) {
        continue;
      }
      instance.putTimepoint(insert.getStanox(), timepoint);
    }
  }
View Full Code Here

  private class ScheduleHandler extends DefaultContentHandler {

    @Override
    public void endElement(Element element) {
      if (element instanceof TiplocInsertElement) {
        TiplocInsertElement insert = (TiplocInsertElement) element;
        String stanox = Integer.toString(insert.getStanox());
        String tiploc = insert.getTiploc();
        List<String> stanoxes = _stanoxByTiploc.get(tiploc);
        if (stanoxes == null) {
          stanoxes = new ArrayList<String>();
          _stanoxByTiploc.put(tiploc, stanoxes);
        }
View Full Code Here

TOP

Related Classes of org.onebusaway.uk.network_rail.cif.TiplocInsertElement

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.