Blame view

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