59 lines
1.1 KiB
Java
59 lines
1.1 KiB
Java
package Domäne;
|
|
|
|
import tpe.exceptions.roboter.exceptions.RobotException;
|
|
import tpe.exceptions.roboter.exceptions.RobotIllegalStateException;
|
|
|
|
public class Nexus6 extends Roboter {
|
|
|
|
String name;
|
|
int id;
|
|
RobotException fehler;
|
|
private static Nexus6 PRIS;
|
|
|
|
|
|
private Nexus6() {
|
|
super("Pris");
|
|
this.id = 19_281_982;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Nexus6 getInstance () {
|
|
if (PRIS == null) {
|
|
PRIS = new Nexus6();
|
|
|
|
}
|
|
return PRIS;
|
|
}
|
|
|
|
@Override
|
|
public void triggerPowerSwitch() {
|
|
power = false;
|
|
}
|
|
|
|
|
|
@Override
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
//Methode soll Fehler ausgeben, da der Roboter nicht Funktioniert.
|
|
@Override
|
|
public String speak(int[] zahlen) throws RobotException {
|
|
fehler = new RobotIllegalStateException ("Roboter ausgeschaltet und Defekt!");
|
|
throw fehler;
|
|
|
|
}
|
|
|
|
//Methode soll Fehler ausgeben, da der Roboter nicht Funktioniert.
|
|
@Override
|
|
public int[] think(int[] zahlen) throws RobotException {
|
|
fehler = new RobotIllegalStateException ("Roboter ausgeschaltet und Defekt!");
|
|
throw fehler;
|
|
|
|
|
|
}
|
|
|
|
}
|