/**
 * The Locked State (for a garage door Controller)
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Locked extends State
{
    private        Controller           controller;
    private static Locked               instance;
    

    /**
     * Explicit Value Constuctor 
     * [used by the enter() method]
     *
     * @param controller   The Controller to use
     */
    private Locked(Controller controller)
    {
       this.controller = controller;
    }
    

    /**
     * Enter this State
     *
     * Specifically, construct an instance if necessary and perform any
     * necessary operations
     *
     * @param controller   The Controller to perform operations on
     * @return             The (singleton) instance of this State
     */
    public static State enter(Controller controller)
    {
       if (instance == null) instance = new Locked(controller);

       return instance;
    }

    
    /**
     * Process a startUnlock transition
     */
    public void startUnlock()
    {
       controller.changeState(AwaitingCombination.enter(controller));
    }
    


}
