throw new NoSuchFuelTypeError("This fuel station does not have fuel of the given type");
}
+ /**
+ * Get the price for a specific type of fuel for this fuel station
+ *
+ * @param fuel_type The {@link 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
+ */
+ public float get_price(FuelType fuel_type) throws NoSuchFuelTypeError {
+ for (Fuel i : fuels) {
+ if (i.FUEL_TYPE == fuel_type) {
+ return i.getPrice();
+ }
+ }
+ throw new NoSuchFuelTypeError("This fuel station does not have fuel of the given type");
+ }
+
}