From ee5de23dea9c20e41de207809227982228376d6f Mon Sep 17 00:00:00 2001 From: <3010678@stud.hs-mannheim.de> Date: Thu, 11 Jan 2024 10:43:27 +0100 Subject: [PATCH] final --- .../informatik/spreadsheet/Axel.java | 3 ++- .../informatik/spreadsheet/Spreadsheet.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java index 619b46c..98d0b86 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java @@ -54,10 +54,11 @@ public class Axel { System.out.println("Do you want to load a csv File?(y/n)"); readInput=sc.nextLine(); if(readInput.equals("y")||readInput.equals("Y")) { - System.out.println("Paste the filpath here:"); + System.out.println("Paste the filepath here:"); readInput= sc.nextLine(); path=readInput; spr.readCsv(path, ",", "A1"); + System.out.println(spr); } diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index 8df082b..58109ba 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -136,6 +136,11 @@ public class Spreadsheet { + + + + + } /** @@ -622,6 +627,18 @@ public class Spreadsheet { return endCell; } + public void clearTable() { + int rows = cells.length; + int cols = cells[0].length; + + for (int r = 0; r < rows; r++) { + for (int c = 0; c < cols; c++) { + cells[r][c].setValue(""); + cells[r][c].setFormula(""); + } + } + } + } \ No newline at end of file