Nexus 6 Singelton Klasse

main
CedricNew 2023-01-07 00:44:04 +01:00
parent 26b65fab46
commit 21ea8aff1d
2 changed files with 42 additions and 0 deletions

View 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>

32
domain/Nexus6.java 100644
View File

@ -0,0 +1,32 @@
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;
}
@Override
public String speak(int[] numbers) throws RobotException {
RobotException e = new RobotException(robotExceptions.ILLEGALSTATE, getName());
this.exceptions = new ExceptionStorage(e);
throw e;
}
@Override
public int[] think(int[] numbers) throws RobotException {
RobotException e = new RobotException(robotExceptions.ILLEGALSTATE, getName());
this.exceptions = new ExceptionStorage(e);
throw e;
}
}