import java.io.*;
import java.util.*;

/**
 * A class that reads in dispatching tasks from the console and hands
 * them off to a Dispatcher
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class RealTimeDispatchHandler extends AbstractDispatchHandler
{
    /**
     * Construct a new DailyDispatchHandler
     *
     * @param d   The Dispatcher to use
     */
    public RealTimeDispatchHandler(Dispatcher d) throws IOException
    {
        super(d, new BufferedReader(new InputStreamReader(System.in)));
    }

    /**
     * Process an individual dispatch (required by 
     * AbstractDispatchHandler).
     *
     * @param line   The dispatch
     */
    public void processDispatch(String line)
    {
        dispatcher.dispatch(line);
    }
}
