package domain; import robot.exceptions.ExceptionStorage; import robot.exceptions.RobotException; import robot.exceptions.robotExceptions; public class R2D2 extends RobotBasics { /** * * @param id> int * @param name> String */ public R2D2(int id, String name){ super(id, name); } public int[] think(int[] input) throws RobotException { if(isPowerOn()){ return selectionSort(input); }else{ this.exceptions = new ExceptionStorage( new RobotException(robotExceptions.ILLEGALSTATE, getName())); throw new RobotException(robotExceptions.ILLEGALSTATE, getName()); } } /* * this method sorts * @param input * @return integer array * @throws RobotException public int[] sorting(int[] input) throws RobotException { if(checkArray(input)){ //Selectionsort int small; for (int i = 0; i