Not.java~
610 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){
tableSondes.getSonde((Interrupteur)in,in,in.getId());
}
}
public String description(){
return getId() + " ||in: "+ in.getId();
}
public boolean getEtat() throws NonConnecteException {
if (in == null) {
throw new NonConnecteException();
} else {
return !in.getEtat();
}
}
}