commentaar Worm methodes

This commit is contained in:
Leen Dereu
2018-03-11 16:04:41 +01:00
parent 2f73e0f684
commit 6374a40469

View File

@@ -31,11 +31,24 @@ public class Worm {
//=================================================================================== //===================================================================================
/** /**
*initialize the new worm with given location, orientation, name and radius
* *
* @param location ... * @param location
* @param orientation ... * the location for the new worm
* @param name ... * @param orientation
* @param radius ... * the orientation for the new worm
* @param name
* the name for the new worm
* @param radius
* the radius for the new worm
* @post the new location of the worm is equal to the given location
* |new.getLocation() == location
* @post the new orientation of the worm is equal to the given orientation
* |new.getOrientation() == orientation
* @post the new name of the worm is equal to the given name
* |new.getName() == name
* @post the new radius of the worm is equal to the given radius
* |new.getRadius() == radius
*/ */
public Worm(Tuple<Double, Double> location, double orientation, String name, double radius) { public Worm(Tuple<Double, Double> location, double orientation, String name, double radius) {
@@ -43,13 +56,40 @@ public class Worm {
} }
/** /**
*initialize the new worm with given location, orientation, name, radius and minimum radius
* *
* @param location ... * @param location
* @param orientation ... * the location for the new worm
* @param name ... * @param orientation
* @param radius ... * the orientation for the new worm
* @param minRadius ... * @param name
* @throws IllegalArgumentException ... * the name for the new worm
* @param radius
* the radius for the new worm
* @param minRadius
* the minimum radius the new worm can have
* @post the new location of the worm is equal to the given location
* |new.getLocation() == location
* @post the new orientation of the worm is equal to the given orientation
* |new.getOrientation() == orientation
* @post the new name of the worm is equal to the given name
* |new.getName() == name
* @post the new radius of the worm is equal to the given radius
* |new.getRadius() == radius
* @post the new minimum radius of the worm is equal to the given minimum radius
* |new.getMinRadius() == minRadius
* @throws IllegalArgumentException
* the given location is not a valid location for a worm
* |!isValidLocation(location)
* @throws IllegalArgumentException
* the given minimum radius is not a valid minimum radius for a worm
* |!isValidMinRadius(minRadius)
* @throws IllegalArgumentException
* the given radius can not be a minimum radius for a worm
* |!canHaveAsMinRadius(radius)
* @throws IllegalNameException
* the given name is not a valid name for a worm
* |isValidName(name)
*/ */
public Worm(Tuple<Double, Double> location, double orientation, String name, double radius, double minRadius) public Worm(Tuple<Double, Double> location, double orientation, String name, double radius, double minRadius)
throws IllegalArgumentException { throws IllegalArgumentException {