changeset 7376:4b26fd60105f

Replaced more tabs with spaces + minor cosmetics (removed out commented code from double precision branch).
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 17 Oct 2013 15:26:12 +0200
parents 450582bcad75
children ad2fdc34910a
files backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java backend/src/main/java/org/dive4elements/river/importer/ImportRange.java backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java
diffstat 6 files changed, 29 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java	Thu Oct 17 15:13:32 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightSingleValue.java	Thu Oct 17 15:26:12 2013 +0200
@@ -33,7 +33,6 @@
     protected Double height;
     protected Double uncertainty;
     protected Double dataGap;
-    //    protected BigDecimal soundingWidth;
     protected Double soundingWidth;
     protected Double width;
 
@@ -46,8 +45,7 @@
         Double height,
         Double uncertainty,
         Double dataGap,
-	//        BigDecimal soundingWidth,
-	Double soundingWidth,
+        Double soundingWidth,
         Double width
     ) {
         this.bedHeight     = bedHeight;
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportRange.java	Thu Oct 17 15:13:32 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportRange.java	Thu Oct 17 15:26:12 2013 +0200
@@ -32,7 +32,7 @@
 
     public ImportRange(BigDecimal a, BigDecimal b) {
 
-	// enforce a<b and set only a for zero-length ranges
+        // enforce a<b and set only a for zero-length ranges
         if (a != null && b == null) {
             this.a = a;
             this.b = null;
@@ -50,7 +50,7 @@
         }
         else {
             if (a.compareTo(b) > 0) {
-		BigDecimal t = a; a = b; b = t;
+                BigDecimal t = a; a = b; b = t;
             }
             this.a = a;
             this.b = b;
@@ -84,9 +84,7 @@
         if (this.b != null && a.compareTo(b) >= 0) {
             throw new IllegalArgumentException("a (" + a + ") must be smaller than b (" + b + ").");
         }
-        else {
-            this.a = a;
-        }
+        this.a = a;
     }
 
     public BigDecimal getB() {
@@ -97,9 +95,7 @@
         if (b != null && b.compareTo(a) <= 0) {
             throw new IllegalArgumentException("b (" + b + ") must be greater than a (" + a + ") or null.");
         }
-        else {
-            this.b = b;
-        }
+        this.b = b;
     }
 
     public Range getPeer(River river) {
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Thu Oct 17 15:13:32 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Thu Oct 17 15:26:12 2013 +0200
@@ -337,7 +337,8 @@
             String tmp = m.group(1).replace(";", "").trim();
 
             BedHeightType bht = BedHeightType.fetchBedHeightTypeForType(
-		tmp, ImporterSession.getInstance().getDatabaseSession());
+                tmp,
+                ImporterSession.getInstance().getDatabaseSession());
 
             if (bht != null) {
                 obj.setType(new ImportBedHeightType(bht));
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java	Thu Oct 17 15:13:32 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java	Thu Oct 17 15:26:12 2013 +0200
@@ -114,7 +114,7 @@
 
         if (m.matches()) {
             String mainValueStr = m.group(1);
-	    log.debug("mainValueStr = '" + mainValueStr + "'");
+            log.debug("mainValueStr = '" + mainValueStr + "'");
             String gaugeStr     = m.group(2);
 
             Object[] valueData = handleMainValueString(mainValueStr);
@@ -151,7 +151,7 @@
     protected Object[] handleMainValueString(String mainValueStr) {
         Matcher mA = META_MAINVALUE_A.matcher(mainValueStr.trim());
         if (mA.matches()) {
-	    log.debug("mainValueStr matches META_MAINVALUE_A");
+            log.debug("mainValueStr matches META_MAINVALUE_A");
             String name = mA.group(0);
 
             return new Object[] { name, name };
@@ -159,7 +159,7 @@
 
         Matcher mB = META_MAINVALUE_B.matcher(mainValueStr.trim());
         if (mB.matches()) {
-	    log.debug("mainValueStr matches META_MAINVALUE_B");
+            log.debug("mainValueStr matches META_MAINVALUE_B");
             String lower = mB.group(1);
             String upper = mB.group(4);
 
@@ -168,7 +168,7 @@
 
         Matcher mC = META_MAINVALUE_C.matcher(mainValueStr.trim());
         if (mC.matches()) {
-	    log.debug("mainValueStr matches META_MAINVALUE_C");
+            log.debug("mainValueStr matches META_MAINVALUE_C");
             String facA  = mC.group(1);
             String nameA = mC.group(2);
             String facB  = mC.group(3);
@@ -184,7 +184,7 @@
 
         Matcher mD = META_MAINVALUE_D.matcher(mainValueStr.trim());
         if (mD.matches()) {
-	    log.debug("mainValueStr matches META_MAINVALUE_D");
+            log.debug("mainValueStr matches META_MAINVALUE_D");
             String loFacA  = mD.group(2);
             String loNameA = mD.group(3);
             String loFacB  = mD.group(4);
@@ -209,14 +209,14 @@
 
         Matcher mE = META_MAINVALUE_E.matcher(mainValueStr.trim());
         if (mE.matches()) {
-	    log.debug("mainValueStr matches META_MAINVALUE_E");
+            log.debug("mainValueStr matches META_MAINVALUE_E");
             String lower = mE.group(1);
             String upper = mE.group(4);
 
             return new Object[] { lower, upper };
         }
 
-	log.debug("mainValueStr not matched");
+    log.debug("mainValueStr not matched");
         return null;
     }
 
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java	Thu Oct 17 15:13:32 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java	Thu Oct 17 15:26:12 2013 +0200
@@ -92,12 +92,10 @@
         if (handleMetaDepth(line)) {
             return;
         }
-	else if (handleMetaYear(line)) {
-	    return;
-	}
-        else {
-            log.warn("Unknown meta line: '" + line + "'");
+        if (handleMetaYear(line)) {
+            return;
         }
+        log.warn("Unknown meta line: '" + line + "'");
     }
 
 
@@ -139,11 +137,10 @@
 
             log.info("Found sediment density year: " + yearString);
 
-	    return true;
+            return true;
         }
-        else {
-            log.debug("Meta line doesn't contain year: " + line);
-        }
+
+        log.debug("Meta line doesn't contain year: " + line);
 
         return false;
     }
@@ -177,14 +174,14 @@
         }
 
         BigDecimal year = null;
-	if (yearString != null) {
-	    try {
-		year = new BigDecimal(nf.parse(yearString).doubleValue());
-	    }
-	    catch (ParseException pe) {
-		log.warn("Unparseable year string");
-	    }
-	}
+        if (yearString != null) {
+            try {
+                year = new BigDecimal(nf.parse(yearString).doubleValue());
+            }
+            catch (ParseException pe) {
+                log.warn("Unparseable year string");
+            }
+        }
 
         current.addValue(new ImportSedimentDensityValue(
             km,
--- a/backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java	Thu Oct 17 15:13:32 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java	Thu Oct 17 15:26:12 2013 +0200
@@ -47,7 +47,6 @@
     private Double height;
     private Double uncertainty;
     private Double dataGap;
-    //    private BigDecimal soundingWidth;
     private Double soundingWidth;
     private Double width;
 
@@ -61,8 +60,7 @@
         Double height,
         Double uncertainty,
         Double dataGap,
-	//        BigDecimal soundingWidth,
-	Double soundingWidth,
+        Double soundingWidth,
         Double width
     ) {
         this.bedHeight     = bedHeight;

http://dive4elements.wald.intevation.org