Code cleanup

This commit is contained in:
serso
2016-01-30 22:28:58 +01:00
parent 51ced42d8e
commit 3797f26330
29 changed files with 51 additions and 73 deletions

View File

@@ -55,9 +55,8 @@ public abstract class AbstractJsclArithmeticException extends ArithmeticExceptio
AbstractJsclArithmeticException that = (AbstractJsclArithmeticException) o;
if (!message.equals(that.message)) return false;
return message.equals(that.message);
return true;
}
@Override

View File

@@ -108,9 +108,8 @@ public class ExtendedConstant implements Comparable<ExtendedConstant>, IConstant
ExtendedConstant that = (ExtendedConstant) o;
if (!constant.equals(that.constant)) return false;
return constant.equals(that.constant);
return true;
}
@Override

View File

@@ -196,7 +196,7 @@ public class Pow extends Algebraic {
}
public Generic selfNumeric() {
return ((NumericWrapper) parameters[0]).pow((NumericWrapper) parameters[1]);
return ((NumericWrapper) parameters[0]).pow(parameters[1]);
}
public String toString() {

View File

@@ -144,7 +144,7 @@ final class TreePolynomial extends Polynomial {
Iterator it = content.entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry) it.next();
p.content.put(((Monomial) e.getKey()).multiply(monomial), (Generic) e.getValue());
p.content.put(((Monomial) e.getKey()).multiply(monomial), e.getValue());
}
p.degree = degree + monomial.degree();
p.sugar = sugar + monomial.degree();
@@ -171,7 +171,7 @@ final class TreePolynomial extends Polynomial {
Iterator it = content.entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry) it.next();
p.content.put(((Monomial) e.getKey()).divide(monomial), (Generic) e.getValue());
p.content.put(((Monomial) e.getKey()).divide(monomial), e.getValue());
}
p.degree = degree + monomial.degree();
p.sugar = sugar + monomial.degree();

View File

@@ -130,7 +130,7 @@ public class ParserUtils {
}
public static <T, U> T[] copyOf(U[] array, int newLength, Class<? extends T[]> newType) {
T[] copy = ((Object) newType == (Object) Object[].class)
T[] copy = (newType == Object[].class)
? (T[]) new Object[newLength]
: (T[]) Array.newInstance(newType.getComponentType(), newLength);

View File

@@ -48,7 +48,7 @@ public abstract class AbstractExpressionGenerator<T> {
return Math.random() * MAX_VALUE;
}
protected static enum Operation {
protected enum Operation {
addition(0, "+"),
subtraction(1, "-"),
multiplication(2, "*"),
@@ -79,7 +79,7 @@ public abstract class AbstractExpressionGenerator<T> {
}
}
protected static enum Function {
protected enum Function {
sin(0, "sin"),
cos(1, "cos"),
sqrt(2, ""),