Package Domäne
Class R2D2
java.lang.Object
Domäne.Roboter
Domäne.R2D2
- All Implemented Interfaces:
Robot,RobotControl,RobotInstructions
Die Klasse R2D2 erbt von Roboter.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Domäne.Roboter
getLastException, getName, isPowerOn, speak, triggerPowerSwitch
-
Constructor Details
-
R2D2
- Parameters:
name- Name des Roboters.id- Eine zufällig vergebene Zahl zwischen 0-9999.
-
-
Method Details
-
think
Description copied from interface:RobotInstructionsSortiert ein Array von Zahlen. Die Reihenfolge hängt von dem Typ des Roboters ab.- Specified by:
thinkin interfaceRobotInstructions- Specified by:
thinkin classRoboter- Parameters:
zahlen- Zahlen, die sortiert werden sollen.- Returns:
- Sortierte Zahlen
- Throws:
RobotIllegalStateException- wenn der Roboter ausgeschaltet ist.RobotException- wenn der Roboter in einem ungültigen Zustand ist, oder das Array nicht seinen Vorstellungen entspricht.- See Also:
-
getId
public int getId()Description copied from interface:RobotControlGibt die ID (Seriennummer) des Roboters zurück.- Specified by:
getIdin interfaceRobotControl- Specified by:
getIdin classRoboter- Returns:
- Eine eindeutige Identifikation in Form einer Zahl.
- See Also:
-
RobotControl#getId(int)
-
getRobotType
Description copied from class:Robotergibt den Typ des Roboters zurück- Specified by:
getRobotTypein classRoboter- See Also:
-
Roboter#getRobotType(robotType)
-