From 3797f26330140c51b3aa849f1201380846e183cd Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 30 Jan 2016 22:28:58 +0100 Subject: [PATCH] Code cleanup --- .../android/calculator/AndroidNumeralBase.java | 11 ++++------- .../calculator/CalculatorEventContainer.java | 2 +- .../calculator/CalculatorEventDataImpl.java | 13 +++---------- .../android/calculator/CalculatorFragmentType.java | 6 +++--- .../android/calculator/CalculatorMenu.java | 2 +- .../calculator/model/MathEntityBuilder.java | 6 +++--- .../plot/AbstractCalculatorPlotFragment.java | 4 ++-- .../calculator/plot/CalculatorPlotterImpl.java | 6 +----- .../android/calculator/plot/GraphView.java | 14 +++++++------- .../android/calculator/plot/PlotBoundaries.java | 3 +-- .../android/calculator/plot/PlotFunction.java | 3 +-- .../android/calculator/plot/PlotLineColor.java | 2 +- .../android/calculator/plot/PlotLineColorType.java | 2 +- .../android/calculator/plot/PlotLineDef.java | 3 +-- .../android/calculator/plot/PlotLineStyle.java | 2 +- .../android/calculator/plot/TouchHandler.java | 2 +- .../android/calculator/plot/XyFunction.java | 8 +++----- .../calculator/units/CalculatorNumeralBase.java | 2 +- .../android/calculator/variables/CppVariable.java | 3 +-- .../calculator/view/UnitConverterViewBuilder.java | 2 +- .../calculator/wizard/DragButtonWizardStep.java | 2 +- .../solovyev/android/sherlock/FragmentItem.java | 4 ++-- .../java/org/solovyev/android/wizard/Wizards.java | 4 ++-- .../java/jscl/AbstractJsclArithmeticException.java | 3 +-- .../java/jscl/math/function/ExtendedConstant.java | 3 +-- jscl/src/main/java/jscl/math/function/Pow.java | 2 +- .../java/jscl/math/polynomial/TreePolynomial.java | 4 ++-- jscl/src/main/java/jscl/text/ParserUtils.java | 2 +- .../jscl/util/AbstractExpressionGenerator.java | 4 ++-- 29 files changed, 51 insertions(+), 73 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/AndroidNumeralBase.java b/app/src/main/java/org/solovyev/android/calculator/AndroidNumeralBase.java index c71d425f..5ac49236 100644 --- a/app/src/main/java/org/solovyev/android/calculator/AndroidNumeralBase.java +++ b/app/src/main/java/org/solovyev/android/calculator/AndroidNumeralBase.java @@ -23,19 +23,16 @@ package org.solovyev.android.calculator; import android.app.Activity; - +import jscl.NumeralBase; +import org.solovyev.android.calculator.units.CalculatorNumeralBase; import org.solovyev.android.views.dragbutton.DirectionDragButton; import org.solovyev.android.views.dragbutton.DragDirection; -import org.solovyev.android.calculator.units.CalculatorNumeralBase; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.annotation.Nonnull; - -import jscl.NumeralBase; - /** * User: serso * Date: 4/21/12 @@ -95,7 +92,7 @@ public enum AndroidNumeralBase { @Nonnull private final CalculatorNumeralBase calculatorNumeralBase; - private AndroidNumeralBase(@Nonnull CalculatorNumeralBase calculatorNumeralBase) { + AndroidNumeralBase(@Nonnull CalculatorNumeralBase calculatorNumeralBase) { this.calculatorNumeralBase = calculatorNumeralBase; } diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorEventContainer.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorEventContainer.java index 69922286..4d550832 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorEventContainer.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorEventContainer.java @@ -42,7 +42,7 @@ public interface CalculatorEventContainer { void fireCalculatorEvents(@Nonnull List calculatorEvents); - public static class CalculatorEvent { + class CalculatorEvent { @Nonnull private CalculatorEventData calculatorEventData; diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorEventDataImpl.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorEventDataImpl.java index 788f5db9..cc7c9a7a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorEventDataImpl.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorEventDataImpl.java @@ -75,10 +75,7 @@ class CalculatorEventDataImpl implements CalculatorEventData { if (this.sequenceId == NO_SEQUENCE) { return false; } - if (this.sequenceId == that.getSequenceId()) { - return true; - } - return false; + return this.sequenceId == that.getSequenceId(); } @Override @@ -86,10 +83,7 @@ class CalculatorEventDataImpl implements CalculatorEventData { if (this.sequenceId == NO_SEQUENCE) { return false; } - if (this.sequenceId > that.getSequenceId()) { - return true; - } - return false; + return this.sequenceId > that.getSequenceId(); } @Override @@ -100,9 +94,8 @@ class CalculatorEventDataImpl implements CalculatorEventData { CalculatorEventDataImpl that = (CalculatorEventDataImpl) o; if (eventId != that.eventId) return false; - if (sequenceId != that.sequenceId) return false; + return sequenceId == that.sequenceId; - return true; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java index e4a984f1..92c6dbbf 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java @@ -75,9 +75,9 @@ public enum CalculatorFragmentType { private Class fragmentClass; private int defaultTitleResId; - private CalculatorFragmentType(@Nonnull Class fragmentClass, - int defaultLayoutId, - int defaultTitleResId) { + CalculatorFragmentType(@Nonnull Class fragmentClass, + int defaultLayoutId, + int defaultTitleResId) { this.fragmentClass = fragmentClass; this.defaultLayoutId = defaultLayoutId; this.defaultTitleResId = defaultTitleResId; diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorMenu.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorMenu.java index 3c7d1172..d8cd1057 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorMenu.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorMenu.java @@ -87,7 +87,7 @@ enum CalculatorMenu implements LabeledMenuItem { private final int captionResId; - private CalculatorMenu(int captionResId) { + CalculatorMenu(int captionResId) { this.captionResId = captionResId; } diff --git a/app/src/main/java/org/solovyev/android/calculator/model/MathEntityBuilder.java b/app/src/main/java/org/solovyev/android/calculator/model/MathEntityBuilder.java index 632efd7c..55fe14a3 100644 --- a/app/src/main/java/org/solovyev/android/calculator/model/MathEntityBuilder.java +++ b/app/src/main/java/org/solovyev/android/calculator/model/MathEntityBuilder.java @@ -36,11 +36,11 @@ import javax.annotation.Nullable; public interface MathEntityBuilder extends JBuilder { @Nonnull - public MathEntityBuilder setName(@Nonnull String name); + MathEntityBuilder setName(@Nonnull String name); @Nonnull - public MathEntityBuilder setDescription(@Nullable String description); + MathEntityBuilder setDescription(@Nullable String description); @Nonnull - public MathEntityBuilder setValue(@Nullable String value); + MathEntityBuilder setValue(@Nullable String value); } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java index a7171f7a..2736a287 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java @@ -407,7 +407,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment return super.onOptionsItemSelected(item) || fragmentMenu.onOptionsItemSelected(this.getActivity(), item); } - private static enum PlotMenu implements IdentifiableMenuItem { + private enum PlotMenu implements IdentifiableMenuItem { functions(R.id.menu_plot_functions) { @Override @@ -425,7 +425,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment private final int itemId; - private PlotMenu(int itemId) { + PlotMenu(int itemId) { this.itemId = itemId; } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotterImpl.java b/app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotterImpl.java index 6b976f17..62a7524b 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotterImpl.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotterImpl.java @@ -325,11 +325,7 @@ public class CalculatorPlotterImpl implements CalculatorPlotter { maxArity = Math.max(maxArity, xyFunction.getArity()); } - if (maxArity > 1) { - plot3d = true; - } else { - plot3d = false; - } + plot3d = maxArity > 1; if (functions.isEmpty()) { // no functions => new plot => default boundaries diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/GraphView.java b/app/src/main/java/org/solovyev/android/calculator/plot/GraphView.java index 12b9874f..a809d554 100755 --- a/app/src/main/java/org/solovyev/android/calculator/plot/GraphView.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/GraphView.java @@ -31,21 +31,21 @@ import javax.annotation.Nonnull; public interface GraphView extends ZoomButtonsController.OnZoomListener, TouchHandler.TouchHandlerListener { - public void init(@Nonnull PlotViewDef plotViewDef); + void init(@Nonnull PlotViewDef plotViewDef); @Nonnull - public List getPlotFunctions(); + List getPlotFunctions(); - public void setPlotFunctions(@Nonnull List plotFunctions); + void setPlotFunctions(@Nonnull List plotFunctions); - public void onDestroy(); + void onDestroy(); - public void onPause(); + void onPause(); - public void onResume(); + void onResume(); @Nonnull - public Bitmap captureScreenshot(); + Bitmap captureScreenshot(); void setXRange(float xMin, float xMax); diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotBoundaries.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotBoundaries.java index 487a4b19..4092821b 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotBoundaries.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotBoundaries.java @@ -109,9 +109,8 @@ public final class PlotBoundaries implements Serializable { if (Float.compare(that.xMax, xMax) != 0) return false; if (Float.compare(that.xMin, xMin) != 0) return false; if (Float.compare(that.yMax, yMax) != 0) return false; - if (Float.compare(that.yMin, yMin) != 0) return false; + return Float.compare(that.yMin, yMin) == 0; - return true; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunction.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunction.java index 2932b380..a526fba3 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunction.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunction.java @@ -124,9 +124,8 @@ public class PlotFunction { PlotFunction that = (PlotFunction) o; - if (!xyFunction.equals(that.xyFunction)) return false; + return xyFunction.equals(that.xyFunction); - return true; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColor.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColor.java index a070b037..400f5d44 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColor.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColor.java @@ -47,7 +47,7 @@ public enum PlotLineColor { private final int color; - private PlotLineColor(int color) { + PlotLineColor(int color) { this.color = color; } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColorType.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColorType.java index 6479e80f..68e6d7f9 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColorType.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineColorType.java @@ -30,5 +30,5 @@ package org.solovyev.android.calculator.plot; public enum PlotLineColorType { monochrome, - color_map; + color_map } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineDef.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineDef.java index 9e05cb5e..161eee9d 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineDef.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineDef.java @@ -171,9 +171,8 @@ public class PlotLineDef { if (lineColor != that.lineColor) return false; if (Float.compare(that.lineWidth, lineWidth) != 0) return false; if (lineColorType != that.lineColorType) return false; - if (lineStyle != that.lineStyle) return false; + return lineStyle == that.lineStyle; - return true; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineStyle.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineStyle.java index 57fc0b69..238bb41d 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineStyle.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotLineStyle.java @@ -33,6 +33,6 @@ public enum PlotLineStyle { solid, dashed, dotted, - dash_dotted; + dash_dotted } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/TouchHandler.java b/app/src/main/java/org/solovyev/android/calculator/plot/TouchHandler.java index 6b54a199..ba4e8896 100755 --- a/app/src/main/java/org/solovyev/android/calculator/plot/TouchHandler.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/TouchHandler.java @@ -104,7 +104,7 @@ class TouchHandler { return velocityTracker.getYVelocity(); } - static interface TouchHandlerListener { + interface TouchHandlerListener { void onTouchDown(float x, float y); void onTouchMove(float x, float y); diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/XyFunction.java b/app/src/main/java/org/solovyev/android/calculator/plot/XyFunction.java index 652593b7..227d1e35 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/XyFunction.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/XyFunction.java @@ -22,14 +22,13 @@ package org.solovyev.android.calculator.plot; +import jscl.math.Generic; +import jscl.math.function.Constant; import org.solovyev.common.text.Strings; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import jscl.math.Generic; -import jscl.math.function.Constant; - public class XyFunction implements FunctionEvaluator { /* @@ -156,9 +155,8 @@ public class XyFunction implements FunctionEvaluator { final XyFunction that = (XyFunction) o; - if (!id.equals(that.id)) return false; + return id.equals(that.id); - return true; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/units/CalculatorNumeralBase.java b/app/src/main/java/org/solovyev/android/calculator/units/CalculatorNumeralBase.java index dbed130c..9a04408a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/units/CalculatorNumeralBase.java +++ b/app/src/main/java/org/solovyev/android/calculator/units/CalculatorNumeralBase.java @@ -54,7 +54,7 @@ public enum CalculatorNumeralBase implements UnitType { @Nonnull private final NumeralBase numeralBase; - private CalculatorNumeralBase(@Nonnull NumeralBase numeralBase) { + CalculatorNumeralBase(@Nonnull NumeralBase numeralBase) { this.numeralBase = numeralBase; } diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/CppVariable.java b/app/src/main/java/org/solovyev/android/calculator/variables/CppVariable.java index ce6f0abd..07a23a2e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/CppVariable.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/CppVariable.java @@ -132,9 +132,8 @@ public class CppVariable implements Jsonable, Parcelable { CppVariable that = (CppVariable) o; if (id != that.id) return false; - if (!name.equals(that.name)) return false; + return name.equals(that.name); - return true; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java b/app/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java index 449e70ec..aad83dbd 100644 --- a/app/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java +++ b/app/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java @@ -232,7 +232,7 @@ public class UnitConverterViewBuilder implements ViewBuilder { spinner.setAdapter(adapter); } - public static interface CustomButtonOnClickListener { + public interface CustomButtonOnClickListener { void onClick(@Nonnull Unit fromUnits, @Nonnull Unit toUnits); } diff --git a/app/src/main/java/org/solovyev/android/calculator/wizard/DragButtonWizardStep.java b/app/src/main/java/org/solovyev/android/calculator/wizard/DragButtonWizardStep.java index 3c33defb..1a90d09c 100644 --- a/app/src/main/java/org/solovyev/android/calculator/wizard/DragButtonWizardStep.java +++ b/app/src/main/java/org/solovyev/android/calculator/wizard/DragButtonWizardStep.java @@ -131,7 +131,7 @@ public class DragButtonWizardStep extends WizardFragment { } } - private static enum DragButtonAction { + private enum DragButtonAction { center(R.string.cpp_wizard_dragbutton_action_center, null), up(R.string.cpp_wizard_dragbutton_action_up, DragDirection.up), down(R.string.cpp_wizard_dragbutton_action_down, DragDirection.down), diff --git a/app/src/main/java/org/solovyev/android/sherlock/FragmentItem.java b/app/src/main/java/org/solovyev/android/sherlock/FragmentItem.java index 93b8b093..09e17ef8 100644 --- a/app/src/main/java/org/solovyev/android/sherlock/FragmentItem.java +++ b/app/src/main/java/org/solovyev/android/sherlock/FragmentItem.java @@ -33,7 +33,7 @@ import javax.annotation.Nonnull; */ public interface FragmentItem { - public void onSelected(@Nonnull FragmentTransaction ft); + void onSelected(@Nonnull FragmentTransaction ft); - public void onUnselected(@Nonnull FragmentTransaction ft); + void onUnselected(@Nonnull FragmentTransaction ft); } diff --git a/app/src/main/java/org/solovyev/android/wizard/Wizards.java b/app/src/main/java/org/solovyev/android/wizard/Wizards.java index ff50b5ed..5c4e9615 100644 --- a/app/src/main/java/org/solovyev/android/wizard/Wizards.java +++ b/app/src/main/java/org/solovyev/android/wizard/Wizards.java @@ -12,8 +12,8 @@ public interface Wizards { Class getActivityClassName(); @Nonnull - public Wizard getWizard(@Nullable String name, @Nullable Bundle arguments) throws IllegalArgumentException; + Wizard getWizard(@Nullable String name, @Nullable Bundle arguments) throws IllegalArgumentException; @Nonnull - public Wizard getWizard(@Nullable String name) throws IllegalArgumentException; + Wizard getWizard(@Nullable String name) throws IllegalArgumentException; } diff --git a/jscl/src/main/java/jscl/AbstractJsclArithmeticException.java b/jscl/src/main/java/jscl/AbstractJsclArithmeticException.java index 429e853c..b810065a 100644 --- a/jscl/src/main/java/jscl/AbstractJsclArithmeticException.java +++ b/jscl/src/main/java/jscl/AbstractJsclArithmeticException.java @@ -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 diff --git a/jscl/src/main/java/jscl/math/function/ExtendedConstant.java b/jscl/src/main/java/jscl/math/function/ExtendedConstant.java index 433ef06d..636ec5eb 100644 --- a/jscl/src/main/java/jscl/math/function/ExtendedConstant.java +++ b/jscl/src/main/java/jscl/math/function/ExtendedConstant.java @@ -108,9 +108,8 @@ public class ExtendedConstant implements Comparable, IConstant ExtendedConstant that = (ExtendedConstant) o; - if (!constant.equals(that.constant)) return false; + return constant.equals(that.constant); - return true; } @Override diff --git a/jscl/src/main/java/jscl/math/function/Pow.java b/jscl/src/main/java/jscl/math/function/Pow.java index 197f097d..0ee44db6 100644 --- a/jscl/src/main/java/jscl/math/function/Pow.java +++ b/jscl/src/main/java/jscl/math/function/Pow.java @@ -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() { diff --git a/jscl/src/main/java/jscl/math/polynomial/TreePolynomial.java b/jscl/src/main/java/jscl/math/polynomial/TreePolynomial.java index 447daa7e..6bc2ee47 100644 --- a/jscl/src/main/java/jscl/math/polynomial/TreePolynomial.java +++ b/jscl/src/main/java/jscl/math/polynomial/TreePolynomial.java @@ -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(); diff --git a/jscl/src/main/java/jscl/text/ParserUtils.java b/jscl/src/main/java/jscl/text/ParserUtils.java index 9e5534bc..a5f39710 100644 --- a/jscl/src/main/java/jscl/text/ParserUtils.java +++ b/jscl/src/main/java/jscl/text/ParserUtils.java @@ -130,7 +130,7 @@ public class ParserUtils { } public static T[] copyOf(U[] array, int newLength, Class newType) { - T[] copy = ((Object) newType == (Object) Object[].class) + T[] copy = (newType == Object[].class) ? (T[]) new Object[newLength] : (T[]) Array.newInstance(newType.getComponentType(), newLength); diff --git a/jscl/src/main/java/jscl/util/AbstractExpressionGenerator.java b/jscl/src/main/java/jscl/util/AbstractExpressionGenerator.java index 06fd565a..6b01f6fb 100644 --- a/jscl/src/main/java/jscl/util/AbstractExpressionGenerator.java +++ b/jscl/src/main/java/jscl/util/AbstractExpressionGenerator.java @@ -48,7 +48,7 @@ public abstract class AbstractExpressionGenerator { 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 { } } - protected static enum Function { + protected enum Function { sin(0, "sin"), cos(1, "cos"), sqrt(2, "√"),