Wheels.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * A bike model in Java. This class models the wheels.
  3. *
  4. * @author Markus Iser, Martin Thoma
  5. * @version 1.0
  6. */
  7. class Wheels {
  8. public static final int MIN_DIAMETER = 150;
  9. public static final int MAX_DIAMETER = 700;
  10. public static final int MIN_WHEEL_SIZE = 20;
  11. public static final int MAX_WHEEL_SIZE = 50;
  12. /** The diameter is in range MIN_DIAMETER to MAX_DIAMETER. */
  13. private int diameter = 559;
  14. /** The wheelsSize is in range MIN_WHEEL_SIZE to MAX_WHEEL_SIZE. */
  15. private double wheelsSize = 50;
  16. /** Price measured in Euro-cents. */
  17. private final int price;
  18. Wheels(int diameter, double wheelSize, int price) {
  19. this.diameter = diameter;
  20. this.wheelsSize = wheelSize;
  21. this.price = price;
  22. }
  23. /**
  24. * @return the price of the wheels in cent
  25. */
  26. int getPrice() {
  27. return price;
  28. }
  29. /**
  30. * @return the diameter in mm
  31. */
  32. public int getDiameter() {
  33. return this.diameter;
  34. }
  35. /**
  36. * @return the size of the wheel in mm
  37. */
  38. public double getWheelsSize() {
  39. return this.wheelsSize;
  40. }
  41. }