Package org.onebusaway.gtfs_transformer.factory

Examples of org.onebusaway.gtfs_transformer.factory.EntityRetentionGraph


    }
  }

  @SuppressWarnings("unchecked")
  private void pruneTrips() {
    EntityRetentionGraph graph = new EntityRetentionGraph(_dao);
    for (Trip trip : _dao.getAllTrips()) {
      List<StopTime> stopTimes = _dao.getStopTimesForTrip(trip);
      if (stopTimes.size() > 1) {
        graph.retainUp(trip);
      }
    }
    for (Class<?> entityClass : GtfsEntitySchemaFactory.getEntityClasses()) {
      List<Object> objectsToRemove = new ArrayList<Object>();
      for (Object entity : _dao.getAllEntitiesForType(entityClass)) {
        if (!graph.isRetained(entity))
          objectsToRemove.add(entity);
      }
      for (Object toRemove : objectsToRemove)
        _dao.removeEntity((IdentityBean<Serializable>) toRemove);
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs_transformer.factory.EntityRetentionGraph

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.