student 2022-11-29 14:00:13 +01:00
parent f629d1e365
commit 5abffc540a
1 changed files with 3 additions and 7 deletions

View File

@ -3,6 +3,7 @@ package de.hs_mannheim.informatik.bank.facade;
import java.util.ArrayList;
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.Girokonto;
@ -30,18 +31,13 @@ public class Banksystem {
public String[] getKontenliste() {
Collection<Konto> konten = bank.getKontenliste();
ArrayList<Konto> al = new ArrayList<>();
for(Konto k : konten) {
al.add(k);
}
Collections.sort(al);
TreeSet<Konto> ts = new TreeSet<>(konten);
String[] liste = new String[konten.size()];
int i = 0;
for (Konto k : al) {
for (Konto k : ts) {
liste[i++] = k.toString();
}