changeset 7917:9ec6def1a7dd

Make grain fraction type 'unknown' explicit and use it where appropriate.
author Tom Gottfried <tom@intevation.de>
date Thu, 05 Jun 2014 15:32:52 +0200
parents c0843a658474
children 5813c206ff64
files backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java backend/src/main/java/org/dive4elements/river/model/GrainFraction.java
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java	Wed Jun 04 18:22:14 2014 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java	Thu Jun 05 15:32:52 2014 +0200
@@ -190,7 +190,7 @@
             String newLine = line.replace(FRAKTION_START, "").trim();
             if (newLine.length() == 0) {
                 log.debug("Found total grain fraction.");
-                this.grainFraction = new ImportGrainFraction(GrainFraction.TOTAL);
+                this.grainFraction = new ImportGrainFraction(GrainFraction.UNKNOWN);
 
                 return true;
             }
@@ -372,8 +372,7 @@
         }
 
         log.warn("SYP: Unknown grain fraction: '" + gfStr + "'");
-
-        return null;
+        return new ImportGrainFraction(GrainFraction.UNKNOWN);
     }
 
 
@@ -402,7 +401,7 @@
         }
         else {
             log.warn("SYP: Unknown grain fraction '" + filename + "'");
-            return "unknown";
+            return GrainFraction.UNKNOWN;
         }
     }
 
--- a/backend/src/main/java/org/dive4elements/river/model/GrainFraction.java	Wed Jun 04 18:22:14 2014 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/GrainFraction.java	Thu Jun 05 15:32:52 2014 +0200
@@ -33,6 +33,7 @@
     public static final String SUSP_SAND          = "susp_sand";
     public static final String SUSP_SAND_BED      = "susp_sand_bed";
     public static final String SUSPENDED_SEDIMENT = "suspended_sediment";
+    public static final String UNKNOWN            = "unknown";
 
 
     private static Logger logger = Logger.getLogger(GrainFraction.class);

http://dive4elements.wald.intevation.org