/*
 * 2006 Utah High School Programming Contest, University of Utah
 * Take-Home Problem
 *
 * Update.java
 *
 * This file contains the implementation of the Update class.
 */

/**
 * An <code>Update</code> represents a fact that has become known about a
 * Sudoku board.  The are two kinds of facts.  An "IS" fact says what the value
 * of a square is, and an "IS_NOT" fact says what the value of a square is not.
 * <code>Update</code>s are "plain data" objects.  They are created and
 * processed by <code>Solver</code> instances.
 *
 * @see Solver
 */
public class Update {
    /**
     * The value of the <code>type</code> field for "is" facts.
     */
    static public final int IS = 0;

    /**
     * The value of the <code>type</code> field for "is-not" facts.
     */
    static public final int IS_NOT = 1;

    public final int row;
    public final int col;
    public final int type;
    public final int value;

    /*************************************************************************/

    /**
     * Creates an <code>Update</code> that describes a fact about a square
     * within a Sudoku board.  The fact says that the value of a square has
     * become known, or that the value the square has become constrained.
     *
     * @param row    the row number of the updated square
     * @param col    the column number of the updated square
     * @param type   <code>Update.IS</code> or <code>Update.IS_NOT</code>
     * @param value  the value that the square is or is not, depending on the
     *               type of this update
     */
    public Update(int row, int col, int type, int value) {
        this.row = row;
        this.col = col;
        this.type = type;
        this.value = value;
    }
}

// End of file.

