for (int i = 0; i < var2.length; i++) {
if (var2[i] == '・') {
if (this.lastSpell != null) {
- setAtom(this.lastSpell, this.magnification);
+ setAtom(this.lastSpell, 1);
}
setAtoms(new Formula(new String(var2, ++i, var2.length - i)));
return;
// 括弧対応はまだ未完成です。 --WIP--
} else if (Character.isDigit(var2[i])) {
if (this.lastIndex > 0) {
- this.amonts.set(this.amonts.size() - 1, this.magnification
- * (this.lastIndex = this.lastIndex * 10 + Integer.valueOf(Character.toString(var2[i]))));
+ this.amonts.set(this.amonts.size() - 1,
+ this.lastIndex = this.lastIndex * 10 + Integer.valueOf(Character.toString(var2[i])));
} else if (this.lastSpell != null) {
setAtom(this.lastSpell, this.lastIndex = Integer.valueOf(Character.toString(var2[i])));
} else {
} else if (Character.isLetter(var2[i])) {
if (Character.isUpperCase(var2[i])) {
if (this.lastSpell != null) {
- setAtom(this.lastSpell, this.magnification);
+ setAtom(this.lastSpell, 1);
}
this.lastSpell = Character.toString(var2[i]);
} else if (Character.isLowerCase(var2[i])) {
throw new IllegalArgumentException();
}
this.lastSpell = this.lastSpell.concat(Character.toString(var2[i]));
-
- if (var2.length <= i + 1) {
- setAtom(this.lastSpell, this.magnification);
- }
}
this.lastIndex = 0;
} else {
throw new IllegalArgumentException();
}
}
+ if (this.lastSpell != null) {
+ setAtom(this.lastSpell, 1);
+ }
}
public boolean isAtom(String par1) {
public void setAtom(String par1, int par2) {
if (isAtom(par1)) {
+ par2 *= this.magnification;
int var3 = this.atoms.indexOf(par1);
if (var3 == -1) {
this.atoms.add(par1);