diff --git a/.idea/Robot_Factory_PR.iml b/.idea/Robot_Factory_PR.iml
index dce5887..5d43cdd 100644
--- a/.idea/Robot_Factory_PR.iml
+++ b/.idea/Robot_Factory_PR.iml
@@ -1,11 +1,11 @@
-
+
-
+
@@ -23,5 +23,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
new file mode 100644
index 0000000..2d95299
--- /dev/null
+++ b/.idea/kotlinc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index d15472f..befc737 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/Main.java b/Main.java
index bc56eb5..80f6a6a 100644
--- a/Main.java
+++ b/Main.java
@@ -1,11 +1,15 @@
import domain.C3PO;
+import domain.R2D2;
public class Main {
public static void main(String[] args) {
- C3PO Herbert = new C3PO(0, "Herbert");
int[] input = {6,5,4,3,2,1};
+ C3PO c = new C3PO(1000, "cc");
+ System.out.println(c.sorting(input));
+ R2D2 r = new R2D2(1000, "cc");
+ System.out.println(r.sorting(input));
//just some testing
/*C3PO Herbert = new C3PO(0, "Herbert");
diff --git a/domain/C3PO.java b/domain/C3PO.java
index 3bb12b0..44f0182 100644
--- a/domain/C3PO.java
+++ b/domain/C3PO.java
@@ -1,10 +1,34 @@
package domain;
-public class C3PO extends RobotBasics {
+import org.junit.jupiter.params.shadow.com.univocity.parsers.common.fields.ColumnMapping;
+import robot.interfaces.Sorting;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class C3PO extends RobotBasics implements Sorting {
public C3PO(int id, String name){
super(id, name);
}
-
-
+ //@Override
+ public String sorting(int[] arr) {
+ //Insertionsort
+ for(int i=1;i=0 && arr[b]>key) arr[b+1] = arr[b--];
+ arr[b+1] = key;
+ }
+ //Writing all values of the array into a String
+ String result = "" + arr[0];
+ if(arr.length > 1) {
+ for (int i = 1; i < arr.length; i++) {
+ result += ";" + arr[i];
+ }
+ }
+ return result;
+ }
}
diff --git a/domain/C3POTest.java b/domain/C3POTest.java
index 49c1359..bcb29b8 100644
--- a/domain/C3POTest.java
+++ b/domain/C3POTest.java
@@ -16,6 +16,7 @@ class C3POTest {
//Tests for basic functions
+ /**
@Test
void getId() {
@@ -42,6 +43,6 @@ class C3POTest {
assertTrue(Herbert.isPowerOn());
}
-
+**/
}
\ No newline at end of file
diff --git a/domain/R2D2.java b/domain/R2D2.java
index c810ee3..54099d0 100644
--- a/domain/R2D2.java
+++ b/domain/R2D2.java
@@ -1,5 +1,9 @@
package domain;
+import robot.interfaces.Sorting;
+
+import java.util.Arrays;
+
public class R2D2 extends RobotBasics {
/**
* Constructor
@@ -8,7 +12,35 @@ public class R2D2 extends RobotBasics {
*/
public R2D2(int id, String name){
super(id, name);
+ }
+ public String sorting(int[] arr) {
+ //Selectionsort
+ int small;
+ for (int i = 0; i 1) {
+ for (int i = 1; i < arr.length; i++) {
+ result += "," + arr[i];
+ }
+ }
+ }
+ return result;
}
}
diff --git a/facade/Factory.java b/facade/Factory.java
deleted file mode 100644
index ad77430..0000000
--- a/facade/Factory.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package facade;
-
-public class Factory {
-}
diff --git a/facade/RobotFactory.java b/facade/RobotFactory.java
new file mode 100644
index 0000000..aa53ee1
--- /dev/null
+++ b/facade/RobotFactory.java
@@ -0,0 +1,10 @@
+package facade;
+
+public class RobotFactory {
+ enum RobotType {
+ C3PO, R2D2
+ }
+
+
+
+}
diff --git a/out/production/Robot_Factory_PR/.idea/Robot_Factory_PR.iml b/out/production/Robot_Factory_PR/.idea/Robot_Factory_PR.iml
index dce5887..5d43cdd 100644
--- a/out/production/Robot_Factory_PR/.idea/Robot_Factory_PR.iml
+++ b/out/production/Robot_Factory_PR/.idea/Robot_Factory_PR.iml
@@ -1,11 +1,11 @@
-
+
-
+
@@ -23,5 +23,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/Robot_Factory_PR/.idea/kotlinc.xml b/out/production/Robot_Factory_PR/.idea/kotlinc.xml
new file mode 100644
index 0000000..2d95299
--- /dev/null
+++ b/out/production/Robot_Factory_PR/.idea/kotlinc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/Robot_Factory_PR/.idea/misc.xml b/out/production/Robot_Factory_PR/.idea/misc.xml
index d15472f..befc737 100644
--- a/out/production/Robot_Factory_PR/.idea/misc.xml
+++ b/out/production/Robot_Factory_PR/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/out/production/Robot_Factory_PR/Main.class b/out/production/Robot_Factory_PR/Main.class
index 02d59ac..8facb63 100644
Binary files a/out/production/Robot_Factory_PR/Main.class and b/out/production/Robot_Factory_PR/Main.class differ
diff --git a/out/production/Robot_Factory_PR/README.md b/out/production/Robot_Factory_PR/README.md
index dc152df..fee4ff6 100644
--- a/out/production/Robot_Factory_PR/README.md
+++ b/out/production/Robot_Factory_PR/README.md
@@ -17,176 +17,248 @@
# Overview
## Packages
-* [Domain](#domain)
- * [R2D2](#-klasse-r2d2-)
- * [R2D2Test](#-testklasse-r2d2test-)
- * [C3P0](#-klasse-c3po-)
- * [Robot](#-interface-robot-)
- * [RobotControl](#-interface-robotcontrol-)
- * [RobotControl](#-interface-robotinstructions-)
-* [Facade](#facade)
- * [Factrory](#-klasse-factory-)
-* [Infrastructure](#infratructure)
- * [Persistenz](#-klasse-persistenz-)
-* [UI](#ui)
+* ### [Domain](#domain-1)
+ * [R2D2](#-classe-r2d2-)
+ * [R2D2Test](#-testclasse-r2d2test-)
+ * [C3P0](#-classe-c3po-)
+ * [C3POTest](#-testclasse-c3potest-)
+ * [RobotBasics](#-class-robotbasics-)
+* ### [Facade](#facade-1)
+ * [Factrory](#-classe-factory-)
+* ### [Infrastructure](#infratructure-1)
+ * [Persistenz](#-classe-persistenz-)
+* ### [robot](#robot-1)
+ * ### [exceptions](#exceptions-1)
+ * [RobotException](#-class-robotexception-)
+ * [RobotIllegalStateException](#-class-robotillegalstateexception-)
+ * [RobotMagicValueException](#-class-robotmagicvalueexception-)
+ * ### [interfaces](#interfaces-1)
+ * [Robot](#-interface-robot-)
+ * [RobotControl](#-interface-robotcontroll-)
+ * [RobotInstructions](#-interface-robotinstructions-)
+ * [Sorting] vorläufig
+* ### [UI](#ui-1)
+ * [UI](#-class-ui-)
## Sidefiles
-* [Main](#-klasse-main-)
+* [Main](#-classe-main-)
* [makefile](#-makefile-for-Git-updates-)
## Domain
- Klasse R2D2
+ Class R2D2
### Variables:
-```
-private int id
-private String name
-private boolean power
-```
+`--not set yet--`
___
### Methods:
-```
-public R2D2():R2D2
-//implemented from interface Robotcontrol
-public getId():int
-public getName():String
-public triggerPowerSWitch():void
-public isPowerOn():boolean
-```
+`public R2D2():R2D2`
- TestKlasse R2D2Test
+
+TestClass R2D2Test
+
### Variables:
-```
-public int id
-public String name
-public R2D2 Herbert
-```
-___
+
+`public int id`
+
+`public String name`
+
+`public R2D2 Herbert`
+___
### Methods:
-```
-@BeforeEach
-setup():void
-@Test
-getId():void
-getName():void
-triggerPowerSwitch():void
-iPowerOn():void
+`@BeforeEach`
+`setup():void`
-```
+`@Test`
- Klasse C3PO
+`getId():void`
+
+`getName():void`
+
+`triggerPowerSwitch():void`
+
+`iPowerOn():void`
+
+
+
+
+Class C3PO
+
### Variables:
-```
---not set yet--
-```
+`--not set yet--`
___
### Methods:
-```
---not set yet--
-```
+`//construtor`
- Interface Robot
+`public C3PO(): C3PO`
+
+
+TestClass C3PO
+
+
+### Variables:
+`public int id`
+
+`public String name`
+
+`public C3PO Herbert`
+___
### Methods:
-```
---not set yet--
-```
+`@BeforeEach`
+`setup():void`
+
+`@Test`
+
+`getId():void`
+
+`getName():void`
+
+`triggerPowerSwitch():void`
+
+`iPowerOn():void`
- Interface RobotControl
+
+
+Class RobotBasics
+
+
+
+### Variables:
+`private int id`
+
+`private String name`
+
+`private boolean power`
+
+___
### Methods:
-```
---not set yet--
-```
+`public RobotBasics():RobotBasics`
+
+`public getId():int`
- Interface RobotInstructions
+`public getName():String`
-### Methods:
-```
---not set yet--
-```
+`public triggerPowerSwitch():void`
+`public ìsPowerOn():boolean`
+
+`public speak():String`
+
+`public think():int[]`
## facade
- Klasse Factory
+ Class Factory
### Variables:
-```
---not set yet--
-```
+`--not set yet--`
___
### Methods:
-```
---not set yet--
-```
+`--not set yet--`
## Infrastructure
- Klasse Persistenz
+ Class Persistenz
### Variables:
-```
---not set yet--
-```
+`--not set yet--`
___
### Methods:
-```
---not set yet--
-```
+`--not set yet--`
+
+## robot
+
+### exceptions
+
+
+Class RobotException
+
+
+#### Methods:
+`public RobotException():Exception`
+
+ Class RobotIllegalStateException
+
+#### Methods:
+`public RobotIllegalStateException():RobotException`
+
+ Class RobotMagicValueException
+
+#### Methods:
+`public RobotMagicValueException():RobotException`
+
+### interfaces
+
+
+Interface Robot
+
+#### Methods:
+`--not set yet--`
+
+
+
+
+Interface RobotControl
+
+
+### Methods:
+`--not set yet--`
+
+
+Interface RobotInstructions
+
+### Methods:
+`--not set yet--`
+
## UI
- Klasse UI
+ Class UI
### Variables:
-```
---not set yet--
-```
+`--not set yet--`
___
### Methods:
-```
---not set yet--
-```
+`--not set yet--`
- Klasse Main
+
+
+
+ Class Main
### Variables:
-```
---not set yet--
-```
+`--not set yet--`
___
### Methods:
-```
---not set yet--
-```
+`--not set yet--`
makefile for Git updates
### Variables:
-```
---not set yet--
-```
+`--not set yet--`
___
### Methods:
-```
-update_readme:
-update_make:
-update_all:
-```
+
+`update_readme:`
+
+`update_make:`
+
+`update_all:`
+
## Aufgabe
diff --git a/out/production/Robot_Factory_PR/domain/C3PO.class b/out/production/Robot_Factory_PR/domain/C3PO.class
index 24cc591..399f232 100644
Binary files a/out/production/Robot_Factory_PR/domain/C3PO.class and b/out/production/Robot_Factory_PR/domain/C3PO.class differ
diff --git a/out/production/Robot_Factory_PR/domain/C3POTest.class b/out/production/Robot_Factory_PR/domain/C3POTest.class
index 0788cbc..f82b21d 100644
Binary files a/out/production/Robot_Factory_PR/domain/C3POTest.class and b/out/production/Robot_Factory_PR/domain/C3POTest.class differ
diff --git a/out/production/Robot_Factory_PR/domain/R2D2.class b/out/production/Robot_Factory_PR/domain/R2D2.class
index d4c6df5..695f6f2 100644
Binary files a/out/production/Robot_Factory_PR/domain/R2D2.class and b/out/production/Robot_Factory_PR/domain/R2D2.class differ
diff --git a/out/production/Robot_Factory_PR/domain/R2D2Test.class b/out/production/Robot_Factory_PR/domain/R2D2Test.class
index e4d0a82..d0bfadf 100644
Binary files a/out/production/Robot_Factory_PR/domain/R2D2Test.class and b/out/production/Robot_Factory_PR/domain/R2D2Test.class differ
diff --git a/out/production/Robot_Factory_PR/domain/RobotBasics.class b/out/production/Robot_Factory_PR/domain/RobotBasics.class
index d04f6ed..0276ff3 100644
Binary files a/out/production/Robot_Factory_PR/domain/RobotBasics.class and b/out/production/Robot_Factory_PR/domain/RobotBasics.class differ
diff --git a/out/production/Robot_Factory_PR/facade/Factory.class b/out/production/Robot_Factory_PR/facade/Factory.class
index c49391e..1a84c02 100644
Binary files a/out/production/Robot_Factory_PR/facade/Factory.class and b/out/production/Robot_Factory_PR/facade/Factory.class differ
diff --git a/out/production/Robot_Factory_PR/infrastructure/Persistenz.class b/out/production/Robot_Factory_PR/infrastructure/Persistenz.class
index f090dbc..6d8d54f 100644
Binary files a/out/production/Robot_Factory_PR/infrastructure/Persistenz.class and b/out/production/Robot_Factory_PR/infrastructure/Persistenz.class differ
diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotException.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotException.class
new file mode 100644
index 0000000..dcf9de5
Binary files /dev/null and b/out/production/Robot_Factory_PR/robot/exceptions/RobotException.class differ
diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotIllegalStateException.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotIllegalStateException.class
new file mode 100644
index 0000000..f93da0b
Binary files /dev/null and b/out/production/Robot_Factory_PR/robot/exceptions/RobotIllegalStateException.class differ
diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotMagicValueException.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotMagicValueException.class
new file mode 100644
index 0000000..3df2fe2
Binary files /dev/null and b/out/production/Robot_Factory_PR/robot/exceptions/RobotMagicValueException.class differ
diff --git a/out/production/Robot_Factory_PR/robot/interfaces/Robot.class b/out/production/Robot_Factory_PR/robot/interfaces/Robot.class
new file mode 100644
index 0000000..bb4dc04
Binary files /dev/null and b/out/production/Robot_Factory_PR/robot/interfaces/Robot.class differ
diff --git a/out/production/Robot_Factory_PR/robot/interfaces/RobotControl.class b/out/production/Robot_Factory_PR/robot/interfaces/RobotControl.class
new file mode 100644
index 0000000..32b877a
Binary files /dev/null and b/out/production/Robot_Factory_PR/robot/interfaces/RobotControl.class differ
diff --git a/out/production/Robot_Factory_PR/robot/interfaces/RobotInstructions.class b/out/production/Robot_Factory_PR/robot/interfaces/RobotInstructions.class
new file mode 100644
index 0000000..6afa03f
Binary files /dev/null and b/out/production/Robot_Factory_PR/robot/interfaces/RobotInstructions.class differ
diff --git a/out/production/Robot_Factory_PR/roboter/interfaces/Sorting.class b/out/production/Robot_Factory_PR/robot/interfaces/Sorting.class
similarity index 54%
rename from out/production/Robot_Factory_PR/roboter/interfaces/Sorting.class
rename to out/production/Robot_Factory_PR/robot/interfaces/Sorting.class
index d73ca12..e2f4c72 100644
Binary files a/out/production/Robot_Factory_PR/roboter/interfaces/Sorting.class and b/out/production/Robot_Factory_PR/robot/interfaces/Sorting.class differ
diff --git a/out/production/Robot_Factory_PR/roboter/exceptions/RobotException.class b/out/production/Robot_Factory_PR/roboter/exceptions/RobotException.class
deleted file mode 100644
index 9dbb2e2..0000000
Binary files a/out/production/Robot_Factory_PR/roboter/exceptions/RobotException.class and /dev/null differ
diff --git a/out/production/Robot_Factory_PR/roboter/exceptions/RobotIllegalStateException.class b/out/production/Robot_Factory_PR/roboter/exceptions/RobotIllegalStateException.class
deleted file mode 100644
index 6939325..0000000
Binary files a/out/production/Robot_Factory_PR/roboter/exceptions/RobotIllegalStateException.class and /dev/null differ
diff --git a/out/production/Robot_Factory_PR/roboter/exceptions/RobotMagicValueException.class b/out/production/Robot_Factory_PR/roboter/exceptions/RobotMagicValueException.class
deleted file mode 100644
index bf585d7..0000000
Binary files a/out/production/Robot_Factory_PR/roboter/exceptions/RobotMagicValueException.class and /dev/null differ
diff --git a/out/production/Robot_Factory_PR/roboter/interfaces/Robot.class b/out/production/Robot_Factory_PR/roboter/interfaces/Robot.class
deleted file mode 100644
index 914d322..0000000
Binary files a/out/production/Robot_Factory_PR/roboter/interfaces/Robot.class and /dev/null differ
diff --git a/out/production/Robot_Factory_PR/roboter/interfaces/RobotControl.class b/out/production/Robot_Factory_PR/roboter/interfaces/RobotControl.class
deleted file mode 100644
index 563286b..0000000
Binary files a/out/production/Robot_Factory_PR/roboter/interfaces/RobotControl.class and /dev/null differ
diff --git a/out/production/Robot_Factory_PR/roboter/interfaces/RobotInstructions.class b/out/production/Robot_Factory_PR/roboter/interfaces/RobotInstructions.class
deleted file mode 100644
index c7cbc45..0000000
Binary files a/out/production/Robot_Factory_PR/roboter/interfaces/RobotInstructions.class and /dev/null differ
diff --git a/out/production/Robot_Factory_PR/ui/UI.class b/out/production/Robot_Factory_PR/ui/UI.class
index 51a0402..043cac3 100644
Binary files a/out/production/Robot_Factory_PR/ui/UI.class and b/out/production/Robot_Factory_PR/ui/UI.class differ