From a9ae1dc55a0aae81eb381949f7bc08059bced509 Mon Sep 17 00:00:00 2001 From: teridax Date: Sat, 1 Jul 2023 12:54:36 +0200 Subject: [PATCH] renamed Girokonto to CurrentAccount --- src/me/teridax/jcash/banking/Account.java | 2 +- .../jcash/banking/{Girokonto.java => CurrentAccount.java} | 4 ++-- src/me/teridax/jcash/gui/account/AccountView.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/me/teridax/jcash/banking/{Girokonto.java => CurrentAccount.java} (63%) diff --git a/src/me/teridax/jcash/banking/Account.java b/src/me/teridax/jcash/banking/Account.java index bf4fc4f..c9a8a49 100644 --- a/src/me/teridax/jcash/banking/Account.java +++ b/src/me/teridax/jcash/banking/Account.java @@ -31,7 +31,7 @@ public abstract class Account { return new SavingsAccount(iban, pin, balance, interest); } else if (type.equals("Girokonto")) { var overdraft = StringUtils.decodeCurrency(columns[5]); - return new Girokonto(iban, pin, balance, overdraft); + return new CurrentAccount(iban, pin, balance, overdraft); } else { throw new IllegalArgumentException("Invalid account type: " + type); } diff --git a/src/me/teridax/jcash/banking/Girokonto.java b/src/me/teridax/jcash/banking/CurrentAccount.java similarity index 63% rename from src/me/teridax/jcash/banking/Girokonto.java rename to src/me/teridax/jcash/banking/CurrentAccount.java index b277057..dc559bf 100644 --- a/src/me/teridax/jcash/banking/Girokonto.java +++ b/src/me/teridax/jcash/banking/CurrentAccount.java @@ -1,10 +1,10 @@ package me.teridax.jcash.banking; -public class Girokonto extends Account { +public class CurrentAccount extends Account { private final double overdraft; - public Girokonto(int iban, int pin, double balance, double overdraft) { + public CurrentAccount(int iban, int pin, double balance, double overdraft) { super(iban, pin, balance); this.overdraft = overdraft; } diff --git a/src/me/teridax/jcash/gui/account/AccountView.java b/src/me/teridax/jcash/gui/account/AccountView.java index ecdf560..781533c 100644 --- a/src/me/teridax/jcash/gui/account/AccountView.java +++ b/src/me/teridax/jcash/gui/account/AccountView.java @@ -50,9 +50,9 @@ public class AccountView extends JPanel { this.balance.setText(StringUtils.LOCAL_NUMBER_FORMAT.format(account.getBalance()) + " €"); this.type.setText(account.getClass().getSimpleName()); - if (account instanceof Girokonto) { + if (account instanceof CurrentAccount) { this.typeSpecialLabel.setText("Overdraft"); - this.typeSpecialProperty.setText( StringUtils.LOCAL_NUMBER_FORMAT.format(((Girokonto) account).getOverdraft()) + " €"); + this.typeSpecialProperty.setText( StringUtils.LOCAL_NUMBER_FORMAT.format(((CurrentAccount) account).getOverdraft()) + " €"); } else if (account instanceof SavingsAccount) { this.typeSpecialLabel.setText("Interest rate"); this.typeSpecialProperty.setText( ((SavingsAccount) account).getInterest() + " %" );