Package org.onebusaway.uk.network_rail.gtfs_realtime.instance

Examples of org.onebusaway.uk.network_rail.gtfs_realtime.instance.TrainInstance


    } else if (matches.size() > 1) {
      _multipleMatches++;
      // _log.warn("multiple matches");
    }
    _singleMatch++;
    TrainInstance instance = instances.iterator().next();
    instance.setLastUpdateTime(Long.parseLong(message.getTime()));
    // System.out.println(_noMatches + " " + _singleMatch + " " +
    // _multipleMatches);
    return instance;
  }
View Full Code Here


  }

  private void removeExpiredTrains() {
    Iterator<TrainInstance> it = _trainsById.values().iterator();
    while (it.hasNext()) {
      TrainInstance instance = it.next();
      if (true) {
        throw new UnsupportedOperationException();
      }
      int timeout = false /*instance.hasMoved()*/ ? _trainMovemenExpirationTimeInSeconds
          : _trainActivationExpirationTimeInSeconds;
      if (_mostRecentTimestamp > instance.getLastUpdateTime() + timeout * 1000) {
        it.remove();
        _narrativeService.closeMessages(instance);
        Set<TrainInstance> instances = _trainsByShortId.get(instance.getTrainReportingNumber());
        if (instances != null) {
          instances.remove(instance);
          if (instances.isEmpty()) {
            _trainsByShortId.remove(instance.getTrainReportingNumber());
          }
        }
      }
    }
  }
View Full Code Here

        if (schedule == null) {
          _log.warn("unknown schedule referenced in saved state: "
              + state.getTrainUid());
          continue;
        }
        TrainInstance instance = new TrainInstance(state.getTrainId(),
            state.getServiceDate());
        fillTimepointsForTrainInstance(instance);
        _trainsById.put(state.getTrainId(), instance);
      }
      in.close();
View Full Code Here

TOP

Related Classes of org.onebusaway.uk.network_rail.gtfs_realtime.instance.TrainInstance

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.