43 lines
828 B
Java
43 lines
828 B
Java
package sudoku;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class MutableCell extends Cell{
|
|
|
|
private final List<Integer> possibleSymbols;
|
|
|
|
public MutableCell() {
|
|
super();
|
|
this.possibleSymbols = new ArrayList<>();
|
|
}
|
|
|
|
public MutableCell(int symbolIndex) {
|
|
super(symbolIndex);
|
|
this.possibleSymbols = new ArrayList<>();
|
|
}
|
|
|
|
public void setSymbolIndex(int symbolIndex) {
|
|
this.symbolIndex = symbolIndex;
|
|
}
|
|
|
|
/**
|
|
* Remove the current symbolIndex and returns it
|
|
* @return integer symbolIndex cleared
|
|
*/
|
|
public int clearCurrentSymbol() {
|
|
int i = this.symbolIndex;
|
|
setSymbolIndex(NOSYMBOLE);
|
|
return i;
|
|
}
|
|
|
|
public void removeSymbolFromPossibilities(int indexSymbol) {
|
|
possibleSymbols.remove(indexSymbol);
|
|
}
|
|
|
|
public List<Integer> getPossibleSymbols() {
|
|
return this.possibleSymbols;
|
|
}
|
|
|
|
}
|