commentaar shape

This commit is contained in:
Leen Dereu
2018-03-08 11:21:31 +01:00
parent 42300e5b5c
commit b2aef5ff19

View File

@@ -243,6 +243,15 @@ public class Worm {
setMass(radius); 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) { private boolean isValidRadius(double radius) {
return radius >= this.minimumRadius && !Double.isNaN(radius); return radius >= this.minimumRadius && !Double.isNaN(radius);
} }
@@ -256,6 +265,14 @@ public class Worm {
return this.minimumRadius; 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) { private boolean isValidMinimumRadius(double radius) {
return !Double.isNaN(radius) && radius > 0; return !Double.isNaN(radius) && radius > 0;
} }