package com.creitz.sudokusolver;
import java.util.HashSet;


//Charles Reitz
//1/4/15

//A container object to represent a square in the sudoku board. 

public class Square {

	private HashSet<Integer> possibleValues = new HashSet<>();
	public static final String EMPTY_SQUARE_INDICATOR = "*";
	
	//the integer value of the square
	private int value = -1;
	
	/**
	 * Initialize the square with the given <code>gridSize</code>, NOT
	 * the value of the square. Use setValue(int) to set the value.
	 * @param gridSize
	 */
	public Square(int gridSize) {
		for (int i=1; i <= gridSize; i++) {
			possibleValues.add(i);
		}	
	}
	
	private void removeAllPossibilities() {
		possibleValues = new HashSet<>();
	}
		
	public HashSet<Integer> possibleValues() {
		return possibleValues;
	}
	
	public void removePossibility(int i) {
		possibleValues.remove(i);
	}
	
	/**
	 * Returns the value of the square.
	 * @return
	 */
	public int getValue() {
		return value;
	}
	
	public boolean hasValue() {
		return value != -1;
	}
	
	/**
	 * Sets the value of the square to the value of <code>val</code>,
	 *  if the square is modifiable.
	 */
	public void setValue(int val) {
		value = val;
		removeAllPossibilities();
	}
	
}

@@ -187,33 +187,34 @@
 ashSet%3CInteger%3E 
-p
+mP
 ossibleValues = 
@@ -587,17 +587,18 @@
 +) %7B%0A%09%09%09
-p
+mP
 ossibleV
@@ -660,25 +660,26 @@
 ities() %7B%0A%09%09
-p
+mP
 ossibleValue
@@ -758,17 +758,18 @@
 %09return 
-p
+mP
 ossibleV
@@ -822,17 +822,18 @@
  i) %7B%0A%09%09
-p
+mP
 ossibleV

Rename member var