private int resourceSchedules( Asset defaultAsset, ArrayList<ResourceSchedule> getResourceSchedules, HashMap<String, Asset> assets, List<SlideshowInterval> timelineIntervalList, int slide, long timeInMillis) { int sizeSchedules = getResourceSchedules.size(); for (int i = 0; i < sizeSchedules - 1; ++i) { ResourceSchedule GetResourceSchedules = getResourceSchedules.get(i); if (timeInMillis > GetResourceSchedules.getStartTime()) { ++slide; } timelineIntervalList.add( resourceScheduleToDate( GetResourceSchedules, assets.get(GetResourceSchedules.getResourceId()))); if (defaultAsset != null) { long getEndTime = GetResourceSchedules.getEndTime(); if (getEndTime != getResourceSchedules.get(i + 1).getStartTime()) { if (getEndTime < timeInMillis) { ++slide; } timelineIntervalList.add( defaultDate( getEndTime, getResourceSchedules.get(i + 1).getStartTime(), defaultAsset)); } } } return slide; }
private SlideshowInterval resourceScheduleToDate(ResourceSchedule schedule, Asset asset) { SlideshowInterval out = new SlideshowInterval(); out.setStartDate(timestampToTimelineDate(schedule.getStartTime())); out.setEndDate(timestampToTimelineDate(schedule.getEndTime())); out.setHeadline(schedule.getName()); out.setAsset(asset); return out; }