Mercurial > dive4elements > river
changeset 7710:a8fd76b15d41
S/Q relation be more correct with judgment if a sieve is correct. Needs load and diameter.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 19 Dec 2013 10:45:14 +0100 (2013-12-19) |
parents | 0737573aa9ac |
children | a35da155865f |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Sieve.java |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java Wed Dec 18 19:51:23 2013 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java Thu Dec 19 10:45:14 2013 +0100 @@ -211,7 +211,7 @@ } for (Sieve s: sieves) { - if (s != null && !Double.isNaN(s.getLoad())) { + if (s != null && s.isValid()) { validSieves.add(s); } }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Sieve.java Wed Dec 18 19:51:23 2013 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Sieve.java Thu Dec 19 10:45:14 2013 +0100 @@ -83,5 +83,13 @@ public boolean hasDiameter() { return !Double.isNaN(diameter); } + + public boolean hasLoad() { + return !Double.isNaN(load); + } + + public boolean isValid() { + return hasDiameter() && hasLoad(); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :