Model initial draft
This commit is contained in:
parent
81e22d094b
commit
a56a3be9ef
2 changed files with 5 additions and 5 deletions
|
@ -12,11 +12,11 @@ public class BombCell implements Cell {
|
|||
public BombCell() {}
|
||||
|
||||
public double cellValue(Environment e) {
|
||||
throw XLException.RECURSIVECELL_ERROR;
|
||||
throw XLException.ERROR_RECURSIVE;
|
||||
}
|
||||
|
||||
public String displayValue() {
|
||||
throw XLException.RECURSIVECELL_ERROR;
|
||||
throw XLException.ERROR_RECURSIVE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ public class XLModel extends Observable implements Environment {
|
|||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw XLException.CREATECELL_ERROR;
|
||||
throw XLException.ERROR_CREATECELL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,13 +186,13 @@ public class XLModel extends Observable implements Environment {
|
|||
public double value(String name) {
|
||||
// Check if the cell is referencing itself
|
||||
if (currentAddress.equals(name)) {
|
||||
throw XLException.RECURSIVECELL_ERROR;
|
||||
throw XLException.ERROR_RECURSIVE;
|
||||
}
|
||||
// Check if the cell is empty
|
||||
if (map.containsKey(name)) {
|
||||
return map.get(name).cellValue(this);
|
||||
} else {
|
||||
throw XLException.EMPTY_ERROR;
|
||||
throw XLException.ERROR_EMPTY_REF;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue