diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataResult.java @ 8132:58e3fed51e9e

GetFractionByName now returns a list as it can differ in Epochs One result can be calculated with multiple epochs. there is a todo in there to correctly split up the epochs in the facets.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 25 Aug 2014 20:00:45 +0200
parents fae48b3c09d1
children ce35bdf3d750
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataResult.java	Mon Aug 25 19:59:14 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataResult.java	Mon Aug 25 20:00:45 2014 +0200
@@ -73,13 +73,14 @@
         return fractions;
     }
 
-    public Fraction getFractionByName(String name) {
+    public List<Fraction> getFractionsByName(String name) {
+        List<Fraction> result = new ArrayList<Fraction>();
         for (Fraction fraction: fractions) {
             if (fraction.getName().equals(name)) {
-                return fraction;
+                result.add(fraction);
             }
         }
-        return null;
+        return result.isEmpty() ? null : result;
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org