import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Collection;
//A class for storing information for a cell

public class CellObject {
	private static ArrayList<Integer> ORGINAL_LIST = new ArrayList<Integer>(Arrays.asList(1,2,3,4,5,6,7,8,9));
	private static int FIRST_ELEMENT = 0;
	private static int solvedCount = 0;
	private Integer value;
	private ArrayList<Integer> possibleValues;
	private boolean orginalNumber = false;


	//Store cell's value and give original list of possible values;
	public CellObject(Integer value){
		this.value = value;
		if(value != 0){
			this.orginalNumber = true;
			this.solvedCount++;
		}else{
			this.possibleValues = new ArrayList<Integer>(ORGINAL_LIST);
		}
	}

	//returns a count, this is used to see if any new values were added
	public int getSolvedCount(){
		return solvedCount;
	}
	
	//simple check if value is zero, a placeholder value
	public boolean hasValue(){
		return value != 0;
	}
	
	//sets the value back to zero, a placeholder, and decrement count on number of cells with values 
	public void resetValue(){
		this.value = 0;
		solvedCount--;
	}
	
	//return the arraylist of possible values this cell can have
	public ArrayList<Integer> getPossiblIntegers(){
		return possibleValues;
	}

	//later use for image to bold numbers from original values scanned in from image
	public boolean isOrginal(){
		return orginalNumber;
	}

	//returns value of this cell
	public Integer getValue(){
		return this.value;
	}
	
	//change the value of this cell
	public void setValue(Integer i){
		this.value = i;
		solvedCount++;
	}
	
	//sets the list of possible values and does a few check
	//if list size is zero, then no possible values means the board is invalid
	//otherwise if list is a size of 1, then there is only one possible value for the cell, and assumes that value
	public boolean setValList(ArrayList<Integer> list){
		this.possibleValues = new ArrayList<Integer>(list);
		if(list.size() == 0)
			return false;
		else if(list.size() == 1)
			this.value = list.get(FIRST_ELEMENT);
		return true;	

	}




}

@@ -25,154 +25,8 @@
 st;%0A
-import java.util.Arrays;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport java.util.Collection;
 %0A//A
@@ -66,17 +66,29 @@
 r a cell
-%0A
+ on the board
 %0Apublic 
@@ -119,199 +119,11 @@
 ate 
-static ArrayList%3CInteger%3E ORGINAL_LIST = new ArrayList%3CInteger%3E(Arrays.asList(1,2,3,4,5,6,7,8,9));%0A%09private static int FIRST_ELEMENT = 0;%0A%09private static int solvedCount = 0;%0A%09private Integer
+int
  val
@@ -174,51 +174,41 @@
 es;%0A
+%0A
 %09p
-rivate boolean orginalNumber = false;%0A%0A
+ublic CellObject(int value)
 %0A%09
+%7B
 //St
@@ -272,342 +272,61 @@
 s;%0A%09
-public CellObject(Integer value)%7B%0A%09%09this.value = value;%0A%09%09if(value != 0)%7B%0A%09%09%09this.orginalNumber = true;%0A%09%09%09this.solvedCount++;%0A%09%09%7Delse%7B%0A%09%09%09this.possibleValues = new ArrayList%3CInteger%3E(ORGINAL_LIST);%0A%09%09%7D%0A%09%7D%0A%0A%09//returns a count, this is used to see if any new values were added%0A%09public int getSolvedCount
+%09this.value = value;%0A%09%7D%0A%0A%09public boolean isEmpty
 ()
-%7B
 %0A%09
-%09return solvedCount;%0A%09%7D%0A%09%0A%09
+%7B
 //si
@@ -378,36 +378,8 @@
 lue%0A
-%09public boolean hasValue()%7B%0A
 %09%09re
@@ -393,9 +393,9 @@
 lue 
-!
+=
 = 0;
@@ -520,24 +520,26 @@
 resetValue()
+%0A%09
 %7B%0A%09%09this.val
@@ -550,25 +550,8 @@
  0;%0A
-%09%09solvedCount--;%0A
 %09%7D%0A%09
@@ -654,18 +654,19 @@
 sibl
-Integer
+eValue
 s()
+%0A%09
 %7B%0A%09%09
@@ -696,147 +696,8 @@
 %09%7D%0A%0A
-%09//later use for image to bold numbers from original values scanned in from image%0A%09public boolean isOrginal()%7B%0A%09%09return orginalNumber;%0A%09%7D%0A%0A
 %09//r
@@ -730,23 +730,19 @@
 %09public 
-I
+i
 nt
-eger
  getValu
@@ -744,16 +744,18 @@
 tValue()
+%0A%09
 %7B%0A%09%09retu
@@ -833,18 +833,16 @@
 lue(
-I
+i
 nt
-eger
  i)
+%0A%09
 %7B%0A%09%09
@@ -861,33 +861,16 @@
  i;%0A
-%09%09solvedCount++;%0A
 %09%7D%0A%09%0A%09/
-/
+*
 sets
@@ -920,18 +920,18 @@
  check%0A%09
-//
+* 
 if list 
@@ -996,18 +996,17 @@
 nvalid%0A%09
-//
+*
 otherwis
@@ -1105,16 +1105,19 @@
 at value
+ */
 %0A%09public
@@ -1160,16 +1160,18 @@
 r%3E list)
+%0A%09
 %7B%0A%09%09this
@@ -1315,21 +1315,9 @@
 get(
-FIRST_ELEMENT
+0
 );%0A%09

Refactor code and added new comments