#Not.java# 572 Bytes
/**
 *
 * @author Bernard.Carre@polytech-lille.fr
 */

public class Not extends Porte {
	//...
    protected Composant in;
	
    public void setIn(Composant comp) {	
	in = comp;		
    }
    public void probe(SondesTable tableSondes){
	if(in instanceof Interrupteur){
	    getSonde(in,in,
	}
    }
    public String description(){
	return getId() + " ||in: "+ in.getId();
    }

    
    public boolean getEtat() throws NonConnecteException {
		
	if (in == null) {
			
	    throw new NonConnecteException();
			
	} else {
	    
	    return !in.getEtat();
			
	}
    }
		
}