exo6: add constructor and some sanity checks to Chiffre and Variable
[Project_POO.git] / exo6 / Chiffre.java
1
2 class Chiffre extends Facteur {
3 Character c;
4
5 Chiffre(Character c) throws NotCharacterException {
6 //TODO?: remove extragenous whitespace
7 if (Character.isLetterOrDigit(c)) {
8 this.c = c;
9 } else {
10 throw new NotCharacterException(c + " is not a character type");
11 }
12 }
13
14 private boolean isChiffre() {
15 return Character.isDigit(c);
16 }
17 public double evaluer() {
18 return 0.0;
19 }
20 }