SondesTable.java
984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.* ;
public class SondesTable{
Map<LazySonde,Interrupteur> sondetointerrupteur = new HashMap<LazySonde,Interrupteur>();
Map<Interrupteur,LazySonde> interrupteurtosonde = new HashMap<Interrupteur,LazySonde>();
public Interrupteur getInterrupteur(LazySonde sonde){
return sondetointerrupteur.get(sonde);
}
public LazySonde getSonde(Interrupteur interrupteur,Composant cible, String entree){
if(interrupteurtosonde.containsKey(interrupteur)){
return interrupteurtosonde.get(interrupteur) ;
}
else{
LazySonde lz1= new LazySonde(cible,entree);
interrupteurtosonde.put(interrupteur,lz1);
sondetointerrupteur.put(lz1,interrupteur);
return interrupteurtosonde.get(interrupteur) ;
}
}
public void resetSondes(){
for( LazySonde e :interrupteurtosonde.values()){
e.reset();
}
return ;
}
public void clear(){
sondetointerrupteur.clear();
interrupteurtosonde.clear();
return ;
}
}