package schedule;

import java.util.Date;

/**
 * Classes implementing this interface should be able to provide information
 * necessary to schelude their execution time.
 * 
 * @author Marcel Duris
 */
public interface ISchedulable {

    /** Wildcard matching any parameter */
    public static final int ANYTIME = -1;

    /**
     * Returns next time in future, when task is expected to be run.
     * 
     * @return Date object representing time, when task should be run.
     */
    public Date nextDue();

    /**
     * Checks whether task should run at specified time. This function should
     * accept time generated by nextDue() function.
     * 
     * @param date exact date
     * @return true if and only if task can be scheduled at specified date
     */
    public boolean accepts(Date date);

}
