Blame view

Sonde.java~ 827 Bytes
0498df6f   rsimonin   first commit
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
  import java.util.Scanner;
  public abstract class Sonde extends Composant{
      Composant c1;
      String str1;
      Sonde(Composant c, String str){
  	c1=c;
  	str1=str;
      }
      
      Sonde(){
  	c1=null;
  	str1=null;
      }
      public abstract boolean getEtat() throws NonConnecteException;
      /*public boolean getEtat() throws NonConnecteException{
  	 Scanner sc = new Scanner(System.in);
  	if (str1 == null) {		
  	    throw new NonConnecteException();			
  	} else {
  	    System.out.println(str1+ " de " + c1 + " ,true ou false ? " );
  	    
  	    if (sc.hasNextBoolean()) {
  		boolean str = sc.nextBoolean();
  		return str;
  	    }
  	    else {
  		System.out.println("Nous avons pas compris votre choix, la valeur par default est false !");
  		return false;
  	    }    
  	}
      }*/
      
      public String description(){
  	return c1 + str1 ;
      }
  }