/*
 * j-Algo - a visualization tool for algorithm runs, especially useful for
 * students and lecturers of computer science. j-Algo is written in Java and
 * thus platform independent. Development is supported by Technische Universität
 * Dresden.
 *
 * Copyright (C) 2004-2008 j-Algo-Team, j-algo-development@lists.sourceforge.net
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */
package org.jalgo.module.heapsort.model;

/**
 * Listener interface for the <code>Sequencer</code> class.
 * 
 * @author mbue
 */
public interface SequencerListener {
	/**
	 * This method will be called when it turns out that
	 * a derivation step can be made that was previously
	 * unaccounted for. You can use this to recheck whether
	 * a step can be made. In the current implementation,
	 * this is not really meaningful because states will
	 * immediately be derived when becoming current, and
	 * this will only be done once.
	 */
	void stepAvail();
	
	/**
	 * Notification that the sequencer has made a step.
	 * 
	 * @param q Previous state.
	 * @param a Action taken.
	 * @param q1 Next (now current) state.
	 */
	void step(State q, Action a, State q1);
	
	/**
	 * Notification that the sequencer has made a step back.
	 * 
	 * @param q Previously current state.
	 * @param a Action taken (read: undone).
	 * @param q1 Now current state.
	 */
	void back(State q, Action a, State q1);
}
