SondesTable.java 984 Bytes
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 ;
    }

    
}