Compare commits

..

3 Commits

Author SHA1 Message Date
lukas 2f85e40ff0 test3 2022-12-06 12:17:28 +01:00
lukas d5616f14f6 test2 2022-12-06 12:17:21 +01:00
lukas 65f9d53cee test 2022-12-06 12:15:38 +01:00
9 changed files with 35 additions and 20 deletions

View File

@ -0,0 +1,5 @@
package de.hs_mannheim.informatik.bank.domain;
public class Aktie {
}

View File

@ -2,7 +2,6 @@ package de.hs_mannheim.informatik.bank.domain;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
public class Bank implements Serializable { public class Bank implements Serializable {

View File

@ -0,0 +1,5 @@
package de.hs_mannheim.informatik.bank.domain;
public class Depot extends Geldanlage {
}

View File

@ -0,0 +1,7 @@
package de.hs_mannheim.informatik.bank.domain;
public class Geldanlage {
private Kunde inhaber;
}

View File

@ -3,7 +3,7 @@ package de.hs_mannheim.informatik.bank.domain;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
public class Konto implements Serializable, Comparable { public class Konto extends Geldanlage implements Serializable {
private int nummer; private int nummer;
protected long stand = 0; protected long stand = 0;
private String inhaber; private String inhaber;
@ -23,7 +23,7 @@ public class Konto implements Serializable, Comparable {
@Override @Override
public String toString() { public String toString() {
return "Konto "+ stand + "[nummer=" + nummer + ", inhaber=" + inhaber + "]"; return "Konto [nummer=" + nummer + ", inhaber=" + inhaber + "]";
} }
public String getInhaber() { public String getInhaber() {
@ -73,12 +73,4 @@ public class Konto implements Serializable, Comparable {
return saldo; return saldo;
} }
@Override
public int compareTo(Object other) {
Konto kOther = (Konto) other;
// return (int) (this.stand - kOther.stand);
return this.inhaber.compareTo(kOther.inhaber);
}
} }

View File

@ -0,0 +1,5 @@
package de.hs_mannheim.informatik.bank.domain;
public class Kunde {
}

View File

@ -1,9 +1,6 @@
package de.hs_mannheim.informatik.bank.facade; package de.hs_mannheim.informatik.bank.facade;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.TreeSet;
import de.hs_mannheim.informatik.bank.domain.Bank; import de.hs_mannheim.informatik.bank.domain.Bank;
import de.hs_mannheim.informatik.bank.domain.Girokonto; import de.hs_mannheim.informatik.bank.domain.Girokonto;
@ -30,15 +27,10 @@ public class Banksystem {
public String[] getKontenliste() { public String[] getKontenliste() {
Collection<Konto> konten = bank.getKontenliste(); Collection<Konto> konten = bank.getKontenliste();
TreeSet<Konto> ts = new TreeSet<>(konten);
String[] liste = new String[konten.size()]; String[] liste = new String[konten.size()];
int i = 0; int i = 0;
for (Konto k : ts) { for (Konto k : konten) {
liste[i++] = k.toString(); liste[i++] = k.toString();
} }

View File

@ -0,0 +1,5 @@
package gui;
public class Eventhandler {
}

View File

@ -0,0 +1,5 @@
package gui;
public class Gui {
}