Compare commits
9 Commits
bb2d6179ed
...
master
Author | SHA1 | Date | |
---|---|---|---|
cd1ec136a9 | |||
ea7a52dcb3 | |||
0facc68e7e | |||
e7c5ec3963 | |||
14e15a68ce | |||
19214584c3 | |||
c7defb02a6 | |||
4bef4d00b0 | |||
3775b1c436 |
@@ -23,4 +23,53 @@ public class GebietListe implements ListenInterface
|
|||||||
{
|
{
|
||||||
this.gebiete = gebiete;
|
this.gebiete = gebiete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
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 getAnzahlUnvollständig()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Gebiet> getGebieteNachNamen(String namensanfang)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
public class GebietsDatei implements GebietsQuelle{
|
public class GebietsDatei implements GebietsQuelle{
|
||||||
private ArrayList<Gebiet> gebiete = new ArrayList<>();
|
private ArrayList<Gebiet> gebiete = new ArrayList<>();
|
||||||
|
|
||||||
public void GebietsDatei (String dateiname){
|
public GebietsDatei (String dateiname){
|
||||||
Path pfad = Paths.get(dateiname);
|
Path pfad = Paths.get(dateiname);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
14
src/MockGebietListe.java
Normal file
14
src/MockGebietListe.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
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