commentaar shape
This commit is contained in:
@@ -243,6 +243,15 @@ public class Worm {
|
||||
setMass(radius);
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether the given radius is a valid radius for the worm
|
||||
*
|
||||
* @param radius
|
||||
* the radius to check
|
||||
* @return True if and only if the radius is bigger then the minimum radius
|
||||
* (or equal) and the radius is a number
|
||||
* |result == (radius >= this.minimumRadius && !Double.isNaN(radius))
|
||||
*/
|
||||
private boolean isValidRadius(double radius) {
|
||||
return radius >= this.minimumRadius && !Double.isNaN(radius);
|
||||
}
|
||||
@@ -256,6 +265,14 @@ public class Worm {
|
||||
return this.minimumRadius;
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether the given radius is a valid minimum radius for the worm
|
||||
*
|
||||
* @param radius
|
||||
* the radius to check
|
||||
* @return True if and only if the radius is a number and the radius is bigger then 0
|
||||
* |result == ((!Double.isNaN(radius)) && (radius > 0))
|
||||
*/
|
||||
private boolean isValidMinimumRadius(double radius) {
|
||||
return !Double.isNaN(radius) && radius > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user