Update afficheur
This commit is contained in:
@@ -2,10 +2,13 @@ package impl;
|
||||
|
||||
import interfaces.Capteur;
|
||||
import interfaces.ObserverdeCapteur;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
public class Afficheur implements ObserverdeCapteur {
|
||||
private Canal canalAsync;
|
||||
private int id= new Random().nextInt(100);
|
||||
|
||||
public Afficheur() {}
|
||||
|
||||
@@ -23,7 +26,7 @@ public class Afficheur implements ObserverdeCapteur {
|
||||
try{
|
||||
Future<Integer> futureValue= canalAsync.getValue();
|
||||
Integer value=futureValue.get();
|
||||
System.out.println(value);
|
||||
System.out.println("Afficheur " + id+", value: "+ value);
|
||||
}catch(Exception e){
|
||||
//TODO
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user