tasks
Class Cell

java.lang.Object
  extended by tasks.Cell
All Implemented Interfaces:
java.io.Serializable

public class Cell
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Cell(int x, int y, int size)
          The constructor to be called by the Board when a single Cell is created for the grid.
 
Method Summary
 int[] getPossibleValues()
          Get all the possible values for the cell.
 int getValue()
          Get the value in the cell.
 int getX()
          Get the row coordinate of the cell.
 int getY()
          Get the column coordinate of the cell.
 boolean removeValue(int value)
          Remove the value as being a possibility for the current cell
 void setValue(int value)
          Sets the value at this cell.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cell

public Cell(int x,
            int y,
            int size)
The constructor to be called by the Board when a single Cell is created for the grid.

Parameters:
x - The row coordinate.
y - The column coordinate.
size - The number of possible values the cell can take.
Method Detail

getX

public int getX()
Get the row coordinate of the cell.

Returns:
int The row coordinate of the cell.

getY

public int getY()
Get the column coordinate of the cell.

Returns:
int The column coordinate of the cell.

getValue

public int getValue()
Get the value in the cell.

Returns:
int The value in the cell.

getPossibleValues

public int[] getPossibleValues()
Get all the possible values for the cell.

Returns:
int[] An array that is 1 if the index+1 value is possible, 0 if not.

removeValue

public boolean removeValue(int value)
Remove the value as being a possibility for the current cell

Parameters:
value - The possible value to remove.
Returns:
boolean True if the value was successfully removed without causing a conflict. False if the value to be removed caused a conflict.

setValue

public void setValue(int value)
Sets the value at this cell.

Parameters:
value - The value to set the cell with.