diff artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents b486812f4f14
children 8aa1605e58f1 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java	Thu Jan 18 20:10:59 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java	Thu Jan 18 20:12:01 2018 +0100
@@ -49,7 +49,11 @@
     private DoubleUtil() {
     }
 
-    public static final double [] explode(double from, double to, double step) {
+    public static final double [] explode(
+        double from,
+        double to,
+        double step
+    ) {
         return explode(from, to, step, DEFAULT_STEP_PRECISION);
     }
 
@@ -62,7 +66,8 @@
     }
 
     /**
-     * Returns array with values from parameter from to to with given step width.
+     * Returns array with values from parameter from to to
+     * with given step width.
      * from and to are included.
      */
     public static final double [] explode(
@@ -316,8 +321,12 @@
     /** Convieniance function for results to get an interpolator.
      * This is basically a static wrapper to for LinearInterpolator.interpolate
      * with error handling. Returns null on error.*/
-    public static PolynomialSplineFunction getLinearInterpolator(double[] x, double[] y) {
-        /* We want copies here to remove NaNs but don't change the original data. */
+    public static PolynomialSplineFunction getLinearInterpolator(
+        double[] x,
+        double[] y
+    ) {
+        /* We want copies here to remove NaNs but don't
+         * change the original data. */
         TDoubleArrayList tX = new TDoubleArrayList();
         TDoubleArrayList tY = new TDoubleArrayList();
         for (int i = 0; i < x.length; i++) {
@@ -330,17 +339,23 @@
         try {
             return lpol.interpolate(tX.toNativeArray(), tY.toNativeArray());
         } catch (DimensionMismatchException e) {
-            log.error("KMs and Result values have different sizes. Failed to interpolate: " +
-                    e.getMessage());
+            log.error("KMs and Result values have different sizes. "
+                + "Failed to interpolate: "
+                + e.getMessage());
         } catch (NonMonotonousSequenceException e) {
-            log.error("KMs are not monotonous. Failed to interpolate: " + e.getMessage());
+            log.error("KMs are not monotonous. Failed to interpolate: "
+                + e.getMessage());
         } catch (NumberIsTooSmallException e) {
-            log.error("Result is to small. Failed to interpolate: " + e.getMessage());
+            log.error("Result is to small. Failed to interpolate: "
+                + e.getMessage());
         }
         return null;
     }
 
-    public static PolynomialSplineFunction getLinearInterpolator(TDoubleArrayList x, TDoubleArrayList y) {
+    public static PolynomialSplineFunction getLinearInterpolator(
+        TDoubleArrayList x,
+        TDoubleArrayList y
+    ) {
         return getLinearInterpolator(x.toNativeArray(), y.toNativeArray());
     }
 }

http://dive4elements.wald.intevation.org