Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b75ad5e91a
10
.idea/runConfigurations.xml
Normal file
10
.idea/runConfigurations.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
124
.idea/uiDesigner.xml
Normal file
124
.idea/uiDesigner.xml
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Palette2">
|
||||||
|
<group name="Swing">
|
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Button" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="RadioButton" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="CheckBox" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Label" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||||
|
<preferred-size width="-1" height="20" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
</group>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -4,4 +4,7 @@
|
|||||||
* @author Gubitz, Wöstemeyer, Pfannenstiel, Maier, Vigier :D
|
* @author Gubitz, Wöstemeyer, Pfannenstiel, Maier, Vigier :D
|
||||||
*/
|
*/
|
||||||
public class EinkommenInfo {
|
public class EinkommenInfo {
|
||||||
|
public void main(String[]args){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,57 @@
|
|||||||
* abgeleitete Eigenschaft und wird dementsprechend in der Methode 'getAnzahlEinwohner'
|
* abgeleitete Eigenschaft und wird dementsprechend in der Methode 'getAnzahlEinwohner'
|
||||||
* berechnet.
|
* berechnet.
|
||||||
*
|
*
|
||||||
* @author Gubitz, Wöstemeyer, Pfannenstiel, Maier, Vigier :D
|
* @author Vigier
|
||||||
*/
|
*/
|
||||||
public class Gebiet {
|
public class Gebiet implements GebietInterface {
|
||||||
|
private int jahr;
|
||||||
|
private int schlüssel;
|
||||||
|
private String name;
|
||||||
|
private long gesamtEinkommen;
|
||||||
|
private int durchschnittsEinkommen;
|
||||||
|
|
||||||
|
public Gebiet(int jahr, int schlüssel, String name, long gesamtEinkommen, int durchschnittsEinkommen) {
|
||||||
|
this.jahr = jahr;
|
||||||
|
this.schlüssel = schlüssel;
|
||||||
|
this.name = name;
|
||||||
|
this.gesamtEinkommen = gesamtEinkommen;
|
||||||
|
this.durchschnittsEinkommen = durchschnittsEinkommen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getjahr() {
|
||||||
|
return jahr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSchüssel() {
|
||||||
|
return schlüssel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getGesamtEinkommen() {
|
||||||
|
if(gesamtEinkommen == 0){
|
||||||
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return gesamtEinkommen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDurchschnittsEinkommen() {
|
||||||
|
if(getDurchschnittsEinkommen() == 0){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return durchschnittsEinkommen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getAnzahlEinwohner() {
|
||||||
|
return (int) (gesamtEinkommen / durchschnittsEinkommen);
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* @author Vigier
|
||||||
|
*/
|
||||||
public interface GebietInterface {
|
public interface GebietInterface {
|
||||||
int getjahr();
|
int getjahr();
|
||||||
int getSchüssel();
|
int getSchüssel();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
public class GebietsMoc implements GebietInterface{
|
public class GebietMock implements GebietInterface{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getjahr() {
|
public int getjahr() {
|
@ -1,3 +1,7 @@
|
|||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -6,13 +10,30 @@ import java.util.List;
|
|||||||
* interpretieren, als Gebiet-Objekte zu speichern und diese in Form einer Liste zur Verfügung
|
* interpretieren, als Gebiet-Objekte zu speichern und diese in Form einer Liste zur Verfügung
|
||||||
* zu stellen.
|
* zu stellen.
|
||||||
*
|
*
|
||||||
* @author Gubitz, Wöstemeyer, Pfannenstiel, Maier, Vigier
|
* @author Düsterhaus, Gubitz, Pfannenstiel, Maier, Vigier, Wöstemeyer
|
||||||
*/
|
*/
|
||||||
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 void GebietsDatei (String dateiname){
|
||||||
|
Path pfad = Paths.get(dateiname);
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<String> zeilen = Files.readAllLines(pfad);
|
||||||
|
|
||||||
|
for(String zeile : zeilen) {
|
||||||
|
String[] teile = zeile.split(";");
|
||||||
|
int jahr = Integer.parseInt(teile[0]);
|
||||||
|
int schlüssel = Integer.parseInt(teile[1]);
|
||||||
|
String region = teile[2];
|
||||||
|
int einkommenProHaushalt = Integer.parseInt(teile[3]);
|
||||||
|
int einkommenjeEinwohner = Integer.parseInt(teile[4]);
|
||||||
|
gebiete.add(new Gebiet(jahr, schlüssel, region, einkommenProHaushalt, einkommenjeEinwohner));
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Gebiet> getGebiete() {
|
public List<Gebiet> getGebiete() {
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface der Klasse GebietsDatei.
|
||||||
|
*
|
||||||
|
* @author Düsterhaus, Gubitz, Pfannenstiel, Maier, Vigier, Wöstemeyer
|
||||||
|
*/
|
||||||
|
|
||||||
public interface GebietsQuelle {
|
public interface GebietsQuelle {
|
||||||
List<Gebiet> getGebiete();
|
List<Gebiet> getGebiete();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mockklasse der Klasse GebietsDatei.
|
||||||
|
* Die Klasse 'Gebietsdatei' hat die Aufgabe, die Datei 'Einkommen.csv' einzulesen, zu
|
||||||
|
* interpretieren, als Gebiet-Objekte zu speichern und diese in Form einer Liste zur Verfügung
|
||||||
|
* zu stellen.
|
||||||
|
*
|
||||||
|
* @author Düsterhaus, Gubitz, Pfannenstiel, Maier, Vigier, Wöstemeyer
|
||||||
|
*/
|
||||||
|
|
||||||
public class MockGebietsDatei implements GebietsQuelle {
|
public class MockGebietsDatei implements GebietsQuelle {
|
||||||
private ArrayList<Gebiet> gebiete = new ArrayList<>();
|
private ArrayList<Gebiet> gebiete = new ArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user