for (LimitingResourceQueueElement each : queue
.getLimitingResourceQueueElements()) {
DateAndHour startTime = each.getStartTime();
if (!startTime.isBefore(allocationTime)) {
if (previousEnd == null || startTime.isAfter(previousEnd)) {
Gap gap = Gap.create(queue.getResource(), previousEnd,
startTime);
result.add(GapOnQueueWithQueueElement.create(
gap.onQueue(queue), each));
}
}
previousEnd = each.getEndTime();
}
Gap gap = Gap.create(queue.getResource(), previousEnd, null);
result.add(GapOnQueueWithQueueElement.create(gap.onQueue(queue), null));
return result;
}