package org.atlasapi.schedule;

import java.util.Set;

import org.atlasapi.media.channel.Channel;
import org.atlasapi.media.entity.Publisher;
import org.joda.time.Interval;

import com.google.common.util.concurrent.ListenableFuture;

/**
 * <p>Resolves {@link EquivalentSchedule}s - schedules where sets of equivalent
 * {@link org.atlasapi.content.Item Item}s are present for each
 * {@link org.atlasapi.content.Broadcast Broadcast}.</p>
 * 
 * <p>Schedules are resolvable for a given {@link Interval} on a {@link Channel}
 * according to a particular {@link Publisher source}.</p>
 */
public interface EquivalentScheduleResolver {

    /**
     * <p>Resolve a schedule, according to a {@link Publisher}, of equivalent
     * {@link org.atlasapi.content.Item Item}s broadcast on the provided {@link Channel}s over the given
     * {@link Interval}.</p>
     * 
     * <p>Only Items from the selected sources are returned in the schedule.</p>
     * 
     * @param channels
     *            - channels for which to return schedules.
     * @param interval
     *            - interval over which the schedule should be resolved.
     * @param source
     *            - the schedule source.
     * @param selectedSources
     *            - the sources of which Items should be returned.
     * @return a {@link ListenableFuture} of the resolved schedule.
     */
    // Must source ∈ selectedSources?
    ListenableFuture<EquivalentSchedule> resolveSchedules(Iterable<Channel> channels,
            Interval interval, Publisher source, Set<Publisher> selectedSources);

}

@@ -785,16 +785,23 @@
 provided
+%0A     *
  %7B@link 
@@ -824,23 +824,16 @@
 he given
-%0A     *
  %7B@link 
@@ -940,24 +940,202 @@
 /p%3E%0A     * %0A
+     * %3Cp%3EThe returned %7B@link EquivalentSchedule%7D must contain a (possibly%0A     * empty) %7B@link EquivalentChannelSchedule%7D for each requested%0A     * %7B@link Channel%7D.%3C/p%3E%0A     * %0A
      * @para

improve EquivalentScheduleResolver documentation