From a56a3be9ef1cb5fc1c219a6f203f66e98bbd64d1 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 3 Jun 2024 19:31:45 +0200 Subject: [PATCH] Model initial draft --- app/src/main/java/xl/model/BombCell.java | 4 ++-- app/src/main/java/xl/model/XLModel.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/xl/model/BombCell.java b/app/src/main/java/xl/model/BombCell.java index 748a43f..4f1782d 100644 --- a/app/src/main/java/xl/model/BombCell.java +++ b/app/src/main/java/xl/model/BombCell.java @@ -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; } } diff --git a/app/src/main/java/xl/model/XLModel.java b/app/src/main/java/xl/model/XLModel.java index d7bd4a7..072b43e 100644 --- a/app/src/main/java/xl/model/XLModel.java +++ b/app/src/main/java/xl/model/XLModel.java @@ -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; } }