Nettoyage de la classe JArithmeticInterpreter

This commit is contained in:
Marc Baloup 2014-12-26 16:56:39 +01:00
parent 9ec2dfb95b
commit 6f05cf681f

View File

@ -449,16 +449,19 @@ public class JArithmeticInterpreter {
//.................................................................................... Write_Tree
public String writeTree() {
StringBuffer sb = new StringBuffer();
writeTree(sb);
return sb.toString();
}
private void writeTree(StringBuffer string) {
boolean parenthese=false;
switch(mOperator) {
case -2:
string.append('y');
break;
case -1:
string.append('x');
break;
case 0:
string.append(mValue);
break;
@ -550,7 +553,7 @@ public class JArithmeticInterpreter {
string.append(')');
break;
case 9:
string.append("<EFBFBD>(");
string.append("sqrt(");
fg.writeTree(string);
string.append(')');
break;
@ -605,7 +608,7 @@ public class JArithmeticInterpreter {
signe=-1;
i++;
}
if (chaine.charAt(i)=='<27>') return signe*Math.PI;
if (chaine.charAt(i)=='<27>') return signe*Math.PI; // TODO changer le caractère non reconnu
while (i<longueur && chaine.charAt(i)>47 && chaine.charAt(i)<58) {
temp=temp*10+(chaine.charAt(i)-48);