private ServiceCalendarDate doMap(org.onebusaway.gtfs.model.ServiceCalendarDate rhs) { ServiceCalendarDate lhs = new ServiceCalendarDate(); lhs.setServiceId(AgencyAndIdMapper.mapAgencyAndId(rhs.getServiceId())); lhs.setDate(ServiceDateMapper.mapServiceDate(rhs.getDate())); lhs.setExceptionType(rhs.getExceptionType()); return lhs; }
serviceCalendarDate.getServiceId().setAgencyId(reader.getDefaultAgencyId());
private int getNextServiceId(GtfsMutableRelationalDao dao) { ArrayList<Integer> idList = new ArrayList<>(); for (ServiceCalendarDate svcDate : dao.getAllCalendarDates()) { if (isInt(svcDate.getServiceId().getId())) { idList.add(Integer.parseInt(svcDate.getServiceId().getId())); } } return Collections.max(idList) + 1; }
private int getNextServiceId(GtfsMutableRelationalDao dao) { ArrayList<Integer> idList = new ArrayList<>(); for (ServiceCalendarDate svcDate : dao.getAllCalendarDates()) { if (isInt(svcDate.getServiceId().getId())) { idList.add(Integer.parseInt(svcDate.getServiceId().getId())); } } return Collections.max(idList) + 1; }
private void retainServiceCalendarDate(ServiceCalendarDate calendarDate, boolean retainUp) { if (retainUp) { // Retain up: retain things that depend on the target object retainUp(new ServiceIdKey(calendarDate.getServiceId())); } else { // Retain down: retain things that the target object depends on } }
@Override public int compare(ServiceCalendarDate o1, ServiceCalendarDate o2) { AgencyAndId id1 = o1.getServiceId(); AgencyAndId id2 = o2.getServiceId(); int c = id1.compareTo(id2); if (c != 0) return c; ServiceDate d1 = o1.getDate(); ServiceDate d2 = o2.getDate(); return d1.compareTo(d2); } }
@Override public int compare(ServiceCalendarDate o1, ServiceCalendarDate o2) { AgencyAndId id1 = o1.getServiceId(); AgencyAndId id2 = o2.getServiceId(); int c = id1.compareTo(id2); if (c != 0) return c; ServiceDate d1 = o1.getDate(); ServiceDate d2 = o2.getDate(); return d1.compareTo(d2); } }