From 7472ee85e822f4876017059494bd27163dc5fad7 Mon Sep 17 00:00:00 2001 From: 3011357 <3011357@stud.hs-mannheim.de> Date: Thu, 4 Jan 2024 17:40:21 +0100 Subject: [PATCH] getRow Methode um zweistellige Zahlen erweitert --- .../de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index ceacf6f..3822697 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -6,6 +6,7 @@ import java.io.PrintWriter; import java.util.regex.Matcher; import java.util.regex.Pattern; + /** * A simplified spreadsheet class for the PR1 programming lab at Hochschule Mannheim. * One aspect worth mentioning is that it only supports long numbers, not doubles. @@ -62,6 +63,8 @@ public class Spreadsheet { } private int getRow(String cellName) { + if(cellName.length()==3){ + return Integer.parseInt(cellName.substring(1))-1;} return cellName.charAt(1) - '1'; } @@ -72,7 +75,7 @@ public class Spreadsheet { * A method for reading in data from a CSV file. * @param path The file to read. * @param separator The char used to split up the input, e.g. a comma or a semicolon. - * @param starCellName The upper left cell where data from the CSV file should be inserted. + * @param startCellName The upper left cell where data from the CSV file should be inserted. * @return Nothing. * @exception IOException If path does not exist. */