Added some classes, Implemented a class that creates random strings
This commit is contained in:
35
Learning_is_keyboard/src/Controller/Main.java
Normal file
35
Learning_is_keyboard/src/Controller/Main.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package Controller;
|
||||
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import Model.ModelData;
|
||||
import Model.MyModel;
|
||||
|
||||
import View.MyView;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
ConcurrentLinkedQueue<Integer> qCommands = new ConcurrentLinkedQueue<Integer>();
|
||||
ConcurrentLinkedQueue<ModelData> qDataFromModel = new ConcurrentLinkedQueue<ModelData>();
|
||||
|
||||
Object oThreadLock = new Object();
|
||||
|
||||
MyModel oModel = new MyModel(oThreadLock, qDataFromModel);
|
||||
|
||||
ModelData oModelData = new ModelData("");
|
||||
|
||||
MyView oView = new MyView(oModelData);
|
||||
|
||||
|
||||
|
||||
oModel.start();
|
||||
|
||||
while (true) {
|
||||
|
||||
//Wake up model thread if new task to execute.
|
||||
synchronized(oThreadLock) {
|
||||
oThreadLock.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user