* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template | * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template | ||||
*/ | */ | ||||
package bandit.Model.Generator; | |||||
package bandit.Model; | |||||
import bandit.Model.Zahlengenerator; | import bandit.Model.Zahlengenerator; | ||||
import java.util.concurrent.ExecutorService; | import java.util.concurrent.ExecutorService; | ||||
* | * | ||||
* @author le | * @author le | ||||
*/ | */ | ||||
public class Generator1 implements Runnable // Callable | |||||
public class Wuerfel implements Runnable // Callable | |||||
{ | { | ||||
private static Logger lg = OhmLogger.getLogger(); //Logger sollten immer static sein da sie für alle instanzen loggs ausführen | private static Logger lg = OhmLogger.getLogger(); //Logger sollten immer static sein da sie für alle instanzen loggs ausführen | ||||
private SubmissionPublisher<Integer> wertPublisher; | private SubmissionPublisher<Integer> wertPublisher; | ||||
public Generator1(Zahlengenerator hauptgenerator) | |||||
public Wuerfel(Zahlengenerator hauptgenerator) | |||||
{ | { | ||||
wert = 0; | wert = 0; | ||||
package bandit.Model; | package bandit.Model; | ||||
import bandit.Model.Generator.Generator1; | |||||
//import bandit.Model.Generator.Generator2; | //import bandit.Model.Generator.Generator2; | ||||
//import bandit.Model.Generator.Generator3; | //import bandit.Model.Generator.Generator3; | ||||
import java.util.concurrent.ExecutorService; | import java.util.concurrent.ExecutorService; | ||||
private Flow.Subscription subscription; | private Flow.Subscription subscription; | ||||
private SubmissionPublisher<Integer> wertPublisher; | private SubmissionPublisher<Integer> wertPublisher; | ||||
private Generator1 generator1; | |||||
private Wuerfel generator1; | |||||
private Thread thd1; | private Thread thd1; | ||||
// private Generator2 generator2; | // private Generator2 generator2; | ||||
public Zahlengenerator() | public Zahlengenerator() | ||||
{ | { | ||||
wertPublisher = new SubmissionPublisher<>(); | wertPublisher = new SubmissionPublisher<>(); | ||||
generator1 = new Generator1(this); | |||||
generator1 = new Wuerfel(this); | |||||
// generator2 = new Generator2(this); | // generator2 = new Generator2(this); | ||||
// generator3 = new Generator3(this); | // generator3 = new Generator3(this); | ||||