]> Git Server - tankstelle.git/commitdiff
corrected javadoc syntax for @see and added comments for getter and setter methods...
authorRobin Cheney <cheneyr@eternal.ddnss.de>
Wed, 12 Nov 2025 08:09:37 +0000 (09:09 +0100)
committerRobin Cheney <cheneyr@eternal.ddnss.de>
Wed, 12 Nov 2025 08:09:37 +0000 (09:09 +0100)
src/main/java/de/diejungsvondertanke/tankstelle/Fuel.java
src/main/java/de/diejungsvondertanke/tankstelle/FuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/LargeFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/Main.java
src/main/java/de/diejungsvondertanke/tankstelle/MediumFuelStation.java
src/main/java/de/diejungsvondertanke/tankstelle/Size.java
src/main/java/de/diejungsvondertanke/tankstelle/SmallFuelStation.java

index e1a3de32b550e0f57d6278f5c33cf81cf92d8a33..c7e60e011e77bd23987098a09e5aca139297ed84 100644 (file)
@@ -6,7 +6,7 @@ package de.diejungsvondertanke.tankstelle;
  */
 public class Fuel {
     /**
-     * {@link FuelType}
+     * {@link FuelType FuelType}
      */
     public final FuelType FUEL_TYPE;
 
@@ -41,26 +41,56 @@ public class Fuel {
         this.CAPACITY = capacity;
     }
 
+    /**
+     * Getter method
+     * 
+     * @return {@link FuelType FuelType} of this {@link Fuel Fuel}
+     */
     public FuelType getFuelType() {
         return FUEL_TYPE;
     }
 
+    /**
+     * Getter method
+     * 
+     * @return {@link #stored_amount stored amount of fuel}
+     */
     public float getStored_amount() {
         return stored_amount;
     }
 
+    /**
+     * Set new stored amount of fuel
+     * 
+     * @param stored_amount New stored amount of fuel
+     */
     public void setStored_amount(float stored_amount) {
         this.stored_amount = stored_amount;
     }
 
+    /**
+     * Getter method
+     * 
+     * @return {@link #CAPACITY Maximum fuel capacity}
+     */
     public int getCapacity() {
         return CAPACITY;
     }
 
+    /**
+     * Getter method
+     * 
+     * @return {@link #price price in € / L fuel}
+     */
     public float getPrice() {
         return price;
     }
 
+    /**
+     * Set new price in € / L fuel
+     * 
+     * @param price New price in € / L fuel
+     */
     public void setPrice(float price) {
         this.price = price;
     }
index 102f49939d7a9512a3b1938cebed5f588f6700da..babe1bb877616143a2d7d1dffe67ae366d016722 100644 (file)
@@ -6,12 +6,9 @@ import de.diejungsvondertanke.tankstelle.error.NoSuchFuelTypeError;
  * Abstract class.
  * All fuel station subtypes inherit from this class.
  * 
- * @see {@link LargeFuelStation
- *      LargeFuelStation}
- * @see {@link MediumFuelStation
- *      MediumFuelStation}
- * @see {@link SmallFuelStation
- *      SmallFuelStation}
+ * @see LargeFuelStation
+ * @see MediumFuelStation
+ * @see SmallFuelStation
  */
 abstract class FuelStation {
     /**
@@ -19,14 +16,13 @@ abstract class FuelStation {
      */
     private byte number_of_employees;
     /**
-     * {@link Fuel} types and -amounts
+     * {@link Fuel Fuel} types and -amounts
      */
     public Fuel[] fuels;
 
     /**
-     * The {@link Size} of a fuel station. Is more or less decorative, because you
-     * can infer
-     * the size from the fuel station's type
+     * The {@link Size Size} of a fuel station. Is more or less decorative, because
+     * you can infer the size from the fuel station's type
      */
     private Size size;
 
@@ -34,29 +30,30 @@ abstract class FuelStation {
      * Protected superconstructor for fuel stations
      * 
      * @param number_of_employees Number of employees working at this fuel station
-     * @param size                {@link Size} of the fuel station (see {@link Size}
-     *                            enum)
-     * @param fuels               Array of {@link Fuel}s of this fuel station
-     * @see {@link LargeFuelStation LargeFuelStation}
-     * @see {@link MediumFuelStation MediumFuelStation}
-     * @see {@link SmallFuelStation SmallFuelStation}
+     * @param size                {@link Size Size} of the fuel station (see
+     *                            {@link Size Size} enum)
+     * @param fuels               Array of {@link Fuel Fuel}s of this fuel station
+     * @see LargeFuelStation
+     * @see MediumFuelStation
+     * @see SmallFuelStation
      */
     protected FuelStation(byte number_of_employees, Size size, Fuel[] fuels) {
         this.number_of_employees = number_of_employees;
         this.size = size;
         this.fuels = fuels;
     }
+
     /**
      * Set a new fuel amount for a specific type of fuel for this fuel station
      * 
-     * @param type The {@link FuelType} to change
-     * @param new_amound     The new fuel amound
+     * @param type       The {@link FuelType FuelType} to change
+     * @param new_amount The new fuel amount
      * @throws NoSuchFuelTypeError This Error is thrown on the attempt to choose a
      *                             fuel type from a fuel station
      *                             which the fuel station does not have
      */
-    public void set_stored_amount(float new_amount, FuelType type)throws NoSuchFuelTypeError {
-         for (Fuel i : fuels) {
+    public void set_stored_amount(float new_amount, FuelType type) throws NoSuchFuelTypeError {
+        for (Fuel i : fuels) {
             if (i.FUEL_TYPE == type) {
                 i.setStored_amount(new_amount);
                 return;
@@ -64,19 +61,21 @@ abstract class FuelStation {
             throw new NoSuchFuelTypeError("This fuel station does not have fuel of the given type");
         }
     }
+
     /**
-     * Add or subtract from a fuel amount for a specific type of fuel for this fuel station
+     * Add or subtract from a fuel amount for a specific type of fuel for this fuel
+     * station
      * 
-     * @param type The {@link FuelType} to change
-     * @param new_amound     The aound of fuel that is added or subtracted
+     * @param type       The {@link FuelType FuelType} to change
+     * @param new_amount The amount of fuel that is added or subtracted
      * @throws NoSuchFuelTypeError This Error is thrown on the attempt to choose a
      *                             fuel type from a fuel station
      *                             which the fuel station does not have
      */
-        public void add_stored_amount(float new_amount, FuelType type)throws NoSuchFuelTypeError , ArithmeticException {
-         for (Fuel i : fuels) {
+    public void add_stored_amount(float new_amount, FuelType type) throws NoSuchFuelTypeError, ArithmeticException {
+        for (Fuel i : fuels) {
             if (i.FUEL_TYPE == type) {
-                if (new_amount + i.getStored_amount() < 0){
+                if (new_amount + i.getStored_amount() < 0) {
                     throw new ArithmeticException("Fuel amound can't be negativ");
                 }
                 i.setStored_amount(new_amount + i.getStored_amount());
@@ -89,7 +88,7 @@ abstract class FuelStation {
     /**
      * Set a new price for a specific type of fuel for this fuel station
      * 
-     * @param fuel_type The {@link FuelType} to change
+     * @param fuel_type The {@link FuelType FuelTypes} to change
      * @param price     The new price per litre
      * @throws NoSuchFuelTypeError This Error is thrown on the attempt to choose a
      *                             fuel type from a fuel station
@@ -108,7 +107,7 @@ abstract class FuelStation {
     /**
      * Get the price for a specific type of fuel for this fuel station
      * 
-     * @param fuel_type The {@link FuelType} to get
+     * @param fuel_type The {@link FuelType FuelType} to get
      * @throws NoSuchFuelTypeError This Error is thrown on the attempt to choose a
      *                             fuel type from a fuel station
      *                             which the fuel station does not have
index a8b3d65653b6233abec0a13ee929d1ffd1b1e038..cc7a78fe3b2d337b6fd1bc9ae9690551e8a891b1 100644 (file)
@@ -13,7 +13,7 @@ public class LargeFuelStation extends FuelStation {
      * Constructs large {@link FuelStation fuel station}s
      * 
      * @param supermarket_company The company managing the integrated supermarket
-     * @see {@link #supermarket_company}
+     * @see #supermarket_company
      */
     public LargeFuelStation(String supermarket_company) {
         super((byte) 4, Size.LARGE, new Fuel[] { new Fuel(FuelType.SUPER, 8000f, 0f, 16000),
@@ -29,8 +29,8 @@ public class LargeFuelStation extends FuelStation {
      * 
      * @param supermarket_company The company managing the integrated supermarket
      * @param number_of_employees Number of employees
-     * @see {@link #supermarket_company}
-     * @see {@link FuelStation#number_of_employees}
+     * @see #supermarket_company
+     * @see FuelStation#number_of_employees
      */
     public LargeFuelStation(String supermarket_company, byte number_of_employees) {
         super(number_of_employees, Size.LARGE, new Fuel[] { new Fuel(FuelType.SUPER, 8000f, 0f, 16000),
index 53b3e4f4d4ad7f3871d1ecd62b1e88e397aad5b1..166254648071973a7a48d61fa88eaa0abb625ede 100644 (file)
@@ -72,6 +72,7 @@ public class Main {
         }
         return result.toArray(new FuelStation[0]); // Change to LargeFuelStation if required
     }
+
     /**
      * Get the FuelStation with the highest price
      * 
@@ -80,11 +81,11 @@ public class Main {
      * 
      * @return a FuelStation (all of type {@link FuelStation})
      */
-    public static FuelStation getHighestPrise (FuelType fuelType) throws NoSuchFuelTypeError {
+    public static FuelStation getHighestPrise(FuelType fuelType) throws NoSuchFuelTypeError {
         float highestPrice = fuelStations[0].get_price(fuelType);
         FuelStation HighestStation = fuelStations[0];
         for (FuelStation fuelStation : fuelStations) {
-            if (fuelStation.get_price(fuelType) > highestPrice){
+            if (fuelStation.get_price(fuelType) > highestPrice) {
                 highestPrice = fuelStation.get_price(fuelType);
                 HighestStation = fuelStation;
             }
index 9c890fa0e56e4bbf0e3df4eee2ee632e7121f089..f4d96d3c37ced94b398baa21bdc5a18eb37ff7af 100644 (file)
@@ -13,7 +13,7 @@ public class MediumFuelStation extends FuelStation {
      * Constructs medium {@link FuelStation fuel station}s
      * 
      * @param retail_space m² of retail space
-     * @see {@link #retail_space}
+     * @see #retail_space retail_space
      */
     public MediumFuelStation(float retail_space) {
         super((byte) 2, Size.MEDIUM, new Fuel[] { new Fuel(FuelType.SUPER, 6000f, 0f, 12000),
@@ -28,8 +28,8 @@ public class MediumFuelStation extends FuelStation {
      * 
      * @param retail_space        m² of retail space
      * @param number_of_employees Number of employees
-     * @see {@link #retail_space}
-     * @see {@link FuelStation#number_of_employees}
+     * @see #retail_space
+     * @see FuelStation#number_of_employees
      */
     public MediumFuelStation(float retail_space, byte number_of_employees) {
         super(number_of_employees, Size.MEDIUM, new Fuel[] { new Fuel(FuelType.SUPER, 6000f, 0f, 12000),
index e9c4c182bc89739922a60dcd8ff51fca05dc1779..958627bfc29e116f180b357a61ebbacc28003b72 100644 (file)
@@ -6,9 +6,9 @@ package de.diejungsvondertanke.tankstelle;
  * can infer
  * the size from the fuel station's type
  * 
- * @see {@link LargeFuelStation}
- * @see {@link MediumFuelStation}
- * @see {@link SmallFuelStation}
+ * @see LargeFuelStation
+ * @see MediumFuelStation
+ * @see SmallFuelStation
  */
 public enum Size {
     /**
index ceb96d6312909f0dfa92d6d701354182d32f0930..98ab3b0a5f6b49c15507eec3e3b3cfafafc3f424 100644 (file)
@@ -13,7 +13,7 @@ public class SmallFuelStation extends FuelStation {
      * Constructs small {@link FuelStation fuel station}s
      * 
      * @param number_of_vending_machines Number of drink vending machines
-     * @see {@link #number_of_vending_machines}
+     * @see #number_of_vending_machines
      */
     public SmallFuelStation(short number_of_vending_machines) {
         super((byte) 1, Size.SMALL, new Fuel[] { new Fuel(FuelType.SUPER, 4000f, 0f, 8000),
@@ -26,8 +26,8 @@ public class SmallFuelStation extends FuelStation {
      * 
      * @param number_of_vending_machines Number of drink vending machines
      * @param number_of_employees        Number of employees
-     * @see {@link #number_of_vending_machines}
-     * @see {@link FuelStation#number_of_employees}
+     * @see #number_of_vending_machines
+     * @see FuelStation#number_of_employees
      */
     public SmallFuelStation(short number_of_vending_machines, byte number_of_employees) {
         super(number_of_employees, Size.SMALL, new Fuel[] { new Fuel(FuelType.SUPER, 4000f, 0f, 8000),