2023-01-07 00:44:04 +01:00
|
|
|
package domain;
|
|
|
|
|
|
|
|
import utility.robot_exceptions.ExceptionStorage;
|
|
|
|
import utility.robot_exceptions.RobotException;
|
|
|
|
import utility.robot_exceptions.robotExceptions;
|
|
|
|
|
|
|
|
public final class Nexus6 extends Robot {
|
|
|
|
|
|
|
|
private static final Nexus6 INSTANCE = new Nexus6();
|
|
|
|
|
|
|
|
private Nexus6() {
|
|
|
|
super(1, "Nexus-6", "Nexus-6");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Nexus6 getInstance() {
|
|
|
|
return INSTANCE;
|
|
|
|
}
|
|
|
|
|
2023-01-07 18:35:00 +01:00
|
|
|
//This method always throws an Illegalstate exception
|
2023-01-07 00:44:04 +01:00
|
|
|
@Override
|
|
|
|
public String speak(int[] numbers) throws RobotException {
|
|
|
|
RobotException e = new RobotException(robotExceptions.ILLEGALSTATE, getName());
|
|
|
|
this.exceptions = new ExceptionStorage(e);
|
|
|
|
throw e;
|
|
|
|
}
|
2023-01-07 18:35:00 +01:00
|
|
|
//This method always throws an Illegalstate exception
|
2023-01-07 00:44:04 +01:00
|
|
|
@Override
|
|
|
|
public int[] think(int[] numbers) throws RobotException {
|
|
|
|
RobotException e = new RobotException(robotExceptions.ILLEGALSTATE, getName());
|
|
|
|
this.exceptions = new ExceptionStorage(e);
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
}
|