commit 848405ba11f87d4cda0c3f33394c0eb06e4fbad5
parent 4c4473b89710322368d6de9a4522ce81eaeab2af
Author: William Lindholm <william_lindholm@outlook.com>
Date: Mon, 27 Feb 2023 13:37:05 +0100
Added comments in coffee interface
Diffstat:
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/OOP2023_a22willi_a21liltr_assignment3/src/breakRoom/Main.java b/OOP2023_a22willi_a21liltr_assignment3/src/breakRoom/Main.java
@@ -1,10 +1,13 @@
package breakRoom;
+import java.util.Scanner;
+
public class Main extends Thread {
public static void main(String[] args) throws InterruptedException {
CoffeeQueue queue = new CoffeeQueue();
CoffeeMaker coffeeMachine = new CoffeeMaker(queue);
+ Scanner sc = new Scanner(System.in);
// declare workers
Worker worker1 = new Worker("worker1", queue);
@@ -21,6 +24,7 @@ public class Main extends Thread {
System.out.println("======Started Simulation=====");
+
// wait for 20 seconds
Thread.sleep(20000);
diff --git a/OOP2023_a22willi_a21liltr_assignment3/src/coffee/Coffee.java b/OOP2023_a22willi_a21liltr_assignment3/src/coffee/Coffee.java
@@ -1,9 +1,25 @@
package coffee;
public interface Coffee {
+
+ /**
+ * Get the energy of coffee
+ *
+ * @return returns energy as integer.
+ */
public int getEnergy();
+ /**
+ * Return the type of coffee.
+ *
+ * @return type The type of coffee.
+ */
public String getType();
-
+
+ /**
+ * Set the energy of cofee object.
+ *
+ * @param int energy sets the energy of coffee object.
+ */
public void setEnergy(int energy);
}