Browse Source
Merge commit '7c7ae70a2b179b0cce12df32f2f06dd9664d16e4' into HEAD
feature-pr-BordComputer-setDevices
Merge commit '7c7ae70a2b179b0cce12df32f2f06dd9664d16e4' into HEAD
feature-pr-BordComputer-setDevices
Jenkins
3 years ago
7 changed files with 199 additions and 6 deletions
-
46src/main/java/device/cdPlayer/CDPlayer.java
-
26src/main/java/device/cdPlayer/CDWechseler.java
-
8src/main/java/device/cdPlayer/exceptions/CDWechselerNotRunningException.java
-
7src/main/java/device/cdPlayer/exceptions/ItemNumberNotFoundException.java
-
7src/main/java/device/cdPlayer/exceptions/MaxCapacityExceededException.java
-
7src/main/java/device/cdPlayer/exceptions/NegativeInputException.java
-
102src/test/java/device/cdPlayer/CDPlayerTest.java
@ -0,0 +1,26 @@ |
|||||
|
package device.cdPlayer; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class CDWechseler { |
||||
|
private CD[]CDList=new CD[10]; |
||||
|
private boolean running=false; |
||||
|
|
||||
|
|
||||
|
public boolean isRunning() { |
||||
|
return running; |
||||
|
} |
||||
|
|
||||
|
public void activate() { |
||||
|
this.running = true; |
||||
|
} |
||||
|
|
||||
|
public CD[] getCDList() { |
||||
|
return CDList; |
||||
|
} |
||||
|
|
||||
|
public void loadOneCD(CD cd,int index){ |
||||
|
CDList[index]=cd; |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package device.cdPlayer.exceptions; |
||||
|
|
||||
|
public class CDWechselerNotRunningException extends RuntimeException { |
||||
|
|
||||
|
public CDWechselerNotRunningException() { |
||||
|
super("CDWechseler must be active for using."); |
||||
|
} |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
package device.cdPlayer.exceptions; |
||||
|
|
||||
|
public class ItemNumberNotFoundException extends RuntimeException { |
||||
|
public ItemNumberNotFoundException() { |
||||
|
super("Given ItemNumber ist not in the Album."); |
||||
|
} |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
package device.cdPlayer.exceptions; |
||||
|
|
||||
|
public class MaxCapacityExceededException extends RuntimeException{ |
||||
|
public MaxCapacityExceededException(){ |
||||
|
super("Max capacity of 10-CDs is already exceeded."); |
||||
|
} |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
package device.cdPlayer.exceptions; |
||||
|
|
||||
|
public class NegativeInputException extends RuntimeException{ |
||||
|
public NegativeInputException() { |
||||
|
super("InputNumber must be positive."); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue