changeset 7594:eb4ca9a7eaca

Add isValid method for single double arrays
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 21 Nov 2013 15:40:05 +0100
parents 60a5fc522ec4
children ce1b8a59934e
files artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java	Thu Nov 21 15:37:43 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java	Thu Nov 21 15:40:05 2013 +0100
@@ -218,15 +218,21 @@
 
     public static final boolean isValid(double [][] data) {
         for (double [] ds: data) {
-            for (double d: ds) {
-                if (Double.isNaN(d)) {
-                    return false;
-                }
+            if (!isValid(ds)) {
+                return false;
             }
         }
         return true;
     }
 
+    public static final boolean isValid(double [] data) {
+        for (double d: data) {
+            if (Double.isNaN(d)) {
+                return false;
+            }
+        }
+        return true;
+    }
 
     /** In an array of doubles, search and return the maximum value. */
     public static final double maxInArray(double[] values) {

http://dive4elements.wald.intevation.org