[Dive4elements-commits] [PATCH 04 of 13] Added methods to sediment load object to check fractions

Wald Commits scm-commit at wald.intevation.org
Wed Nov 14 17:26:30 CET 2012


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1352908971 -3600
# Node ID 17d896822d7088ef8f919c1c43aea749488be869
# Parent  457b5444c7d73df29d5bd6ee9ce970829577ec8f
Added methods to sediment load object to check fractions.

diff -r 457b5444c7d7 -r 17d896822d70 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/SedimentLoad.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/SedimentLoad.java	Wed Nov 14 16:59:58 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/SedimentLoad.java	Wed Nov 14 17:02:51 2012 +0100
@@ -160,5 +160,50 @@
             kms.put(km, f);
         }
     }
+
+    public boolean hasCoarse() {
+        for (SedimentLoadFraction slf : kms.values()) {
+            if (slf.getCoarse() > 0d) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean hasFineMiddle() {
+        for (SedimentLoadFraction slf : kms.values()) {
+            if (slf.getFine_middle() > 0d) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean hasSand() {
+        for (SedimentLoadFraction slf : kms.values()) {
+            if (slf.getSand() > 0d) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean hasSuspSand() {
+        for (SedimentLoadFraction slf : kms.values()) {
+            if (slf.getSusp_sand() > 0d) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean hasSuspSediment() {
+        for (SedimentLoadFraction slf : kms.values()) {
+            if (slf.getSusp_sediment() > 0d) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :


More information about the Dive4elements-commits mailing list