Changed visibility of classes
This commit is contained in:
parent
ff54e19845
commit
d7b66238ed
1 changed files with 121 additions and 120 deletions
|
|
@ -138,15 +138,14 @@ public class MathParser {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Math{
|
||||
static abstract class Math{
|
||||
public abstract double exec();
|
||||
|
||||
public abstract String toString();
|
||||
}
|
||||
|
||||
class MathNode extends Math{
|
||||
static class MathNode extends Math{
|
||||
Math math;
|
||||
|
||||
public double exec() {
|
||||
|
|
@ -158,7 +157,7 @@ class MathNode extends Math{
|
|||
}
|
||||
}
|
||||
|
||||
class MathNumber extends Math{
|
||||
static class MathNumber extends Math{
|
||||
double num;
|
||||
|
||||
public double exec() {
|
||||
|
|
@ -170,14 +169,14 @@ class MathNumber extends Math{
|
|||
}
|
||||
}
|
||||
|
||||
abstract class MathOperation extends Math{
|
||||
static abstract class MathOperation extends Math{
|
||||
Math math1;
|
||||
Math math2;
|
||||
|
||||
public abstract double exec();
|
||||
}
|
||||
|
||||
class MathAddition extends MathOperation{
|
||||
static class MathAddition extends MathOperation{
|
||||
public double exec() {
|
||||
return math1.exec() + math2.exec();
|
||||
}
|
||||
|
|
@ -187,7 +186,7 @@ class MathAddition extends MathOperation{
|
|||
}
|
||||
}
|
||||
|
||||
class MathSubtraction extends MathOperation{
|
||||
static class MathSubtraction extends MathOperation{
|
||||
public double exec() {
|
||||
return math1.exec() - math2.exec();
|
||||
}
|
||||
|
|
@ -197,7 +196,7 @@ class MathSubtraction extends MathOperation{
|
|||
}
|
||||
}
|
||||
|
||||
class MathMultiplication extends MathOperation{
|
||||
static class MathMultiplication extends MathOperation{
|
||||
public double exec() {
|
||||
return math1.exec() * math2.exec();
|
||||
}
|
||||
|
|
@ -207,7 +206,7 @@ class MathMultiplication extends MathOperation{
|
|||
}
|
||||
}
|
||||
|
||||
class MathDivision extends MathOperation{
|
||||
static class MathDivision extends MathOperation{
|
||||
public double exec() {
|
||||
return math1.exec() / math2.exec();
|
||||
}
|
||||
|
|
@ -217,7 +216,7 @@ class MathDivision extends MathOperation{
|
|||
}
|
||||
}
|
||||
|
||||
class MathModulus extends MathOperation{
|
||||
static class MathModulus extends MathOperation{
|
||||
public double exec() {
|
||||
return math1.exec() % math2.exec();
|
||||
}
|
||||
|
|
@ -227,7 +226,7 @@ class MathModulus extends MathOperation{
|
|||
}
|
||||
}
|
||||
|
||||
class MathPow extends MathOperation{
|
||||
static class MathPow extends MathOperation{
|
||||
public double exec() {
|
||||
double ret = 1;
|
||||
double tmp1 = math1.exec();
|
||||
|
|
@ -243,7 +242,7 @@ class MathPow extends MathOperation{
|
|||
}
|
||||
}
|
||||
|
||||
class EmptyMath extends MathOperation{
|
||||
static class EmptyMath extends MathOperation{
|
||||
public double exec() {
|
||||
return math1.exec();
|
||||
}
|
||||
|
|
@ -252,3 +251,5 @@ class EmptyMath extends MathOperation{
|
|||
return math1.toString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue