Updated everything. Further explanation in README

main
Philipp3107 2022-12-09 10:45:51 +01:00
parent 90d2d53530
commit 96313208b3
18 changed files with 37 additions and 19 deletions

View File

@ -1,8 +1,12 @@
import domain.C3PO; import domain.C3PO;
import roboter.exceptions.RobotException;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
C3PO Herbert = new C3PO(0, "Herbert");
int[] input = {6,5,4,3,2,1};
//just some testing //just some testing
/*C3PO Herbert = new C3PO(0, "Herbert"); /*C3PO Herbert = new C3PO(0, "Herbert");
int[] input = {6,5,4,3,2,1}; int[] input = {6,5,4,3,2,1};

View File

@ -5,4 +5,6 @@ public class C3PO extends RobotBasics {
super(id, name); super(id, name);
} }
} }

View File

@ -1,7 +1,11 @@
package domain; package domain;
import roboter.exceptions.RobotException; import robot.exceptions.RobotException;
import roboter.exceptions.RobotIllegalStateException; import robot.exceptions.RobotIllegalStateException;
import robot.interfaces.Robot;
import robot.interfaces.RobotControl;
import robot.interfaces.RobotInstructions;
public class RobotBasics implements Robot { public class RobotBasics implements Robot {
private int id; private int id;
@ -14,7 +18,7 @@ public class RobotBasics implements Robot {
this.power = false; this.power = false;
} }
/** /**
* @see domain.RobotControl * @see RobotControl
*/ */
@Override @Override
public int getId() { public int getId() {
@ -22,7 +26,7 @@ public class RobotBasics implements Robot {
} }
/** /**
* @see domain.RobotControl * @see RobotControl
*/ */
@Override @Override
public String getName() { public String getName() {
@ -30,7 +34,7 @@ public class RobotBasics implements Robot {
} }
/** /**
* @see domain.RobotControl * @see RobotControl
*/ */
@Override @Override
public void triggerPowerSwitch() { public void triggerPowerSwitch() {
@ -42,7 +46,7 @@ public class RobotBasics implements Robot {
} }
/** /**
* @see domain.RobotControl * @see RobotControl
*/ */
@Override @Override
public boolean isPowerOn() { public boolean isPowerOn() {
@ -50,7 +54,7 @@ public class RobotBasics implements Robot {
} }
/** /**
* @see roboter.RobotInstructions * @see RobotInstructions
*/ */
@Override @Override
public String speak(int[] zahlen) throws RobotException { public String speak(int[] zahlen) throws RobotException {
@ -66,10 +70,14 @@ public class RobotBasics implements Robot {
} }
/** /**
* @see roboter.RobotInstructions * @see RobotInstructions
*/ */
@Override @Override
public int[] think(int[] zahlen) throws RobotException { public int[] think(int[] zahlen) throws RobotException {
return new int[0]; return new int[0];
} }
} }

View File

@ -1,4 +1,4 @@
package roboter.exceptions; package robot.exceptions;
public class RobotException extends Exception{ public class RobotException extends Exception{
public RobotException(String errorMessage){ public RobotException(String errorMessage){

View File

@ -1,4 +1,4 @@
package roboter.exceptions; package robot.exceptions;
public class RobotIllegalStateException extends RobotException{ public class RobotIllegalStateException extends RobotException{
public RobotIllegalStateException(String errormessage){ public RobotIllegalStateException(String errormessage){

View File

@ -1,4 +1,4 @@
package roboter.exceptions; package robot.exceptions;
public class RobotMagicValueException extends Exception{ public class RobotMagicValueException extends Exception{
public RobotMagicValueException(String errormessage){ public RobotMagicValueException(String errormessage){

View File

@ -1,8 +1,6 @@
/* (c) 2012 Thomas Smits */ /* (c) 2012 Thomas Smits */
//package tpe.exceptions.roboter; //package tpe.exceptions.roboter;
package domain; package robot.interfaces;
import roboter.RobotInstructions;
/** /**
* Interface für Roboter. * Interface für Roboter.

View File

@ -1,5 +1,5 @@
//package tpe.exceptions.roboter; //package tpe.exceptions.roboter;
package domain; package robot.interfaces;
//import tpe.exceptions.roboter.exceptions.RobotException; //import tpe.exceptions.roboter.exceptions.RobotException;

View File

@ -1,7 +1,7 @@
package roboter; package robot.interfaces;
import roboter.exceptions.RobotException; import robot.exceptions.RobotException;
import roboter.exceptions.RobotIllegalStateException; import robot.exceptions.RobotIllegalStateException;
//import tpe.exceptions.roboter.exceptions.RobotMagicValueException; //import tpe.exceptions.roboter.exceptions.RobotMagicValueException;

View File

@ -0,0 +1,6 @@
package robot.interfaces;
@FunctionalInterface
public interface Sorting {
String sorting (int[] input);
}