Compare commits
4 Commits
14e15a68ce
...
master
Author | SHA1 | Date | |
---|---|---|---|
cd1ec136a9 | |||
ea7a52dcb3 | |||
0facc68e7e | |||
e7c5ec3963 |
@@ -26,12 +26,36 @@ public class GebietListe implements ListenInterface
|
|||||||
|
|
||||||
public Gebiet getGebietMinDurchschnittsEinkommen()
|
public Gebiet getGebietMinDurchschnittsEinkommen()
|
||||||
{
|
{
|
||||||
|
int einkommen1 = 0;
|
||||||
|
int minDurchschnitt = 0;
|
||||||
|
Gebiet g = null;
|
||||||
|
for (Gebiet gebiet : gebiete)
|
||||||
|
{
|
||||||
|
einkommen1 = gebiet.getDurchschnittsEinkommen();
|
||||||
|
if (einkommen1 < minDurchschnitt)
|
||||||
|
{
|
||||||
|
minDurchschnitt = einkommen1;
|
||||||
|
g = gebiet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Gebiet getGebietMaxAnzahlEinwohner()
|
public Gebiet getGebietMaxAnzahlEinwohner()
|
||||||
{
|
{
|
||||||
|
int einwohner = 0;
|
||||||
|
int maxEinwohner = 0;
|
||||||
|
Gebiet e = null;
|
||||||
|
for (Gebiet gebiet : gebiete)
|
||||||
|
{
|
||||||
|
einwohner = gebiet.getAnzahlEinwohner();
|
||||||
|
if (einwohner > maxEinwohner)
|
||||||
|
{
|
||||||
|
maxEinwohner = einwohner;
|
||||||
|
e = gebiet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAnzahlGesamt()
|
public int getAnzahlGesamt()
|
||||||
@@ -48,6 +72,4 @@ public class GebietListe implements ListenInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,14 @@
|
|||||||
public class MockGebietListe
|
import java.util.ArrayList;
|
||||||
{
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MockGebietListe implements ListenInterface
|
||||||
|
{
|
||||||
|
private ArrayList<Gebiet> gebiete = new ArrayList<>();
|
||||||
|
|
||||||
|
public void GebietsListe(List<Gebiet> gebiete){ }
|
||||||
|
public Gebiet getGebietMinDurchschnittsEinkommen() {return null;}
|
||||||
|
public Gebiet getGebietMaxAnzahlEinwohner() {return null;}
|
||||||
|
public int getAnzahlGesamt() {return 0;}
|
||||||
|
public int getAnzahlUnvollständig() {return 0;}
|
||||||
|
public List<Gebiet> getGebieteNachNamen(String namensanfang) {return gebiete;}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user