[Dive4elements-commits] [PATCH 1 of 2] SedimentLoad*: Switch from snake_case to camelCase

Wald Commits scm-commit at wald.intevation.org
Thu Jun 20 16:01:54 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1371721367 -7200
# Node ID 8d6f23243d1dc39571959c5983375dd66cb3259b
# Parent  2f39cf68a1ddd0601ee30fe4b4207bade4938869
SedimentLoad*: Switch from snake_case to camelCase.

diff -r 2f39cf68a1dd -r 8d6f23243d1d artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoad.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoad.java	Thu Jun 20 10:09:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoad.java	Thu Jun 20 11:42:47 2013 +0200
@@ -105,12 +105,12 @@
 
     public void setFineMiddle(double km, double fine_middle, Range range) {
         if (kms.containsKey(km)) {
-            kms.get(km).setFine_middle(fine_middle);
+            kms.get(km).setFineMiddle(fine_middle);
             kms.get(km).setFineMiddleRange(range);
         }
         else {
             SedimentLoadFraction f = new SedimentLoadFraction();
-            f.setFine_middle(fine_middle);
+            f.setFineMiddle(fine_middle);
             f.setFineMiddleRange(range);
             kms.put(km, f);
         }
@@ -131,12 +131,12 @@
 
     public void setSuspSand(double km, double susp_sand, Range range) {
         if (kms.containsKey(km)) {
-            kms.get(km).setSusp_sand(susp_sand);
+            kms.get(km).setSuspSand(susp_sand);
             kms.get(km).setSuspSandRange(range);
         }
         else {
             SedimentLoadFraction f = new SedimentLoadFraction();
-            f.setSusp_sand(susp_sand);
+            f.setSuspSand(susp_sand);
             f.setSuspSandRange(range);
             kms.put(km, f);
         }
@@ -144,12 +144,12 @@
 
     public void setSuspSandBed(double km, double susp_sand_bed, Range range) {
         if (kms.containsKey(km)) {
-            kms.get(km).setSusp_sand_bed(susp_sand_bed);
+            kms.get(km).setSuspSandBed(susp_sand_bed);
             kms.get(km).setSuspSandBedRange(range);
         }
         else {
             SedimentLoadFraction f = new SedimentLoadFraction();
-            f.setSusp_sand_bed(susp_sand_bed);
+            f.setSuspSandBed(susp_sand_bed);
             f.setSuspSandBedRange(range);
             kms.put(km, f);
         }
@@ -157,12 +157,12 @@
 
     public void setSuspSediment(double km, double susp_sediment, Range range) {
         if (kms.containsKey(km)) {
-            kms.get(km).setSusp_sediment(susp_sediment);
+            kms.get(km).setSuspSediment(susp_sediment);
             kms.get(km).setSuspSedimentRange(range);
         }
         else {
             SedimentLoadFraction f = new SedimentLoadFraction();
-            f.setSusp_sediment(susp_sediment);
+            f.setSuspSediment(susp_sediment);
             f.setSuspSedimentRange(range);
             kms.put(km, f);
         }
@@ -203,7 +203,7 @@
 
     public boolean hasFineMiddle() {
         for (SedimentLoadFraction slf : kms.values()) {
-            if (slf.getFine_middle() > 0d) {
+            if (slf.getFineMiddle() > 0d) {
                 return true;
             }
         }
@@ -221,7 +221,7 @@
 
     public boolean hasSuspSand() {
         for (SedimentLoadFraction slf : kms.values()) {
-            if (slf.getSusp_sand() > 0d) {
+            if (slf.getSuspSand() > 0d) {
                 return true;
             }
         }
@@ -230,7 +230,7 @@
 
     public boolean hasSuspSediment() {
         for (SedimentLoadFraction slf : kms.values()) {
-            if (slf.getSusp_sediment() > 0d) {
+            if (slf.getSuspSediment() > 0d) {
                 return true;
             }
         }
diff -r 2f39cf68a1dd -r 8d6f23243d1d artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Thu Jun 20 10:09:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Thu Jun 20 11:42:47 2013 +0200
@@ -158,9 +158,9 @@
                     resLoad.setCoarse(km, c + f.getCoarse(), f.getCoarseRange());
                     cSum++;
                 }
-                if (f.getFine_middle() > 0d) {
-                    double fm = resLoad.getFraction(km).getFine_middle();
-                    resLoad.setFineMiddle(km, fm + f.getFine_middle(), f.getFineMiddleRange());
+                if (f.getFineMiddle() > 0d) {
+                    double fm = resLoad.getFraction(km).getFineMiddle();
+                    resLoad.setFineMiddle(km, fm + f.getFineMiddle(), f.getFineMiddleRange());
                     fmSum++;
                 }
                 if (f.getSand() > 0d) {
@@ -168,29 +168,29 @@
                     resLoad.setSand(km, s + f.getSand(), f.getSandRange());
                     sSum++;
                 }
-                if (f.getSusp_sand() > 0d) {
-                    double s = resLoad.getFraction(km).getSusp_sand();
-                    resLoad.setSuspSand(km, s + f.getSusp_sand(), f.getSuspSandRange());
+                if (f.getSuspSand() > 0d) {
+                    double s = resLoad.getFraction(km).getSuspSand();
+                    resLoad.setSuspSand(km, s + f.getSuspSand(), f.getSuspSandRange());
                     ssSum++;
                 }
-                if (f.getSusp_sand_bed() > 0d) {
-                    double s = resLoad.getFraction(km).getSusp_sand_bed();
-                    resLoad.setSuspSandBed(km, s + f.getSusp_sand_bed(), f.getSuspSandBedRange());
+                if (f.getSuspSandBed() > 0d) {
+                    double s = resLoad.getFraction(km).getSuspSandBed();
+                    resLoad.setSuspSandBed(km, s + f.getSuspSandBed(), f.getSuspSandBedRange());
                     ssbSum++;
                 }
-                if (f.getSusp_sediment() > 0d) {
-                    double s = resLoad.getFraction(km).getSusp_sediment();
-                    resLoad.setSuspSediment(km, s + f.getSusp_sediment(), f.getSuspSedimentRange());
+                if (f.getSuspSediment() > 0d) {
+                    double s = resLoad.getFraction(km).getSuspSediment();
+                    resLoad.setSuspSediment(km, s + f.getSuspSediment(), f.getSuspSedimentRange());
                     sseSum++;
                 }
             }
             SedimentLoadFraction fr = resLoad.getFraction(km);
             resLoad.setCoarse(km, fr.getCoarse()/cSum, fr.getCoarseRange());
-            resLoad.setFineMiddle(km, fr.getFine_middle()/fmSum, fr.getFineMiddleRange());
+            resLoad.setFineMiddle(km, fr.getFineMiddle()/fmSum, fr.getFineMiddleRange());
             resLoad.setSand(km, fr.getSand()/sSum, fr.getSandRange());
-            resLoad.setSuspSand(km, fr.getSusp_sand()/ssSum, fr.getSuspSandRange());
-            resLoad.setSuspSandBed(km, fr.getSusp_sand_bed()/ssbSum, fr.getSuspSandBedRange());
-            resLoad.setSuspSediment(km, fr.getSusp_sediment()/sseSum, fr.getSuspSedimentRange());
+            resLoad.setSuspSand(km, fr.getSuspSand()/ssSum, fr.getSuspSandRange());
+            resLoad.setSuspSandBed(km, fr.getSuspSandBed()/ssbSum, fr.getSuspSandBedRange());
+            resLoad.setSuspSediment(km, fr.getSuspSediment()/sseSum, fr.getSuspSedimentRange());
         }
         resLoad.setDescription("");
         resLoad.setEpoch(true);
@@ -308,19 +308,19 @@
                 addProblem(km, "missing data.sand");
                 continue;
             }
-            if (fraction.getSusp_sand() <= 0d && load.hasSuspSand()) {
+            if (fraction.getSuspSand() <= 0d && load.hasSuspSand()) {
                 addProblem(km, "missing.data.susp_sand");
                 continue;
             }
-            if (fraction.getSusp_sediment() <= 0d && load.hasSuspSediment()) {
+            if (fraction.getSuspSediment() <= 0d && load.hasSuspSediment()) {
                 addProblem(km, "missing.data.susp_sediment");
                 continue;
             }
             total += fraction.getCoarse() +
-                fraction.getFine_middle() +
+                fraction.getFineMiddle() +
                 fraction.getSand() +
-                fraction.getSusp_sand() +
-                fraction.getSusp_sediment();
+                fraction.getSuspSand() +
+                fraction.getSuspSediment();
             load.setTotal(km, total, fraction.getTotalRange());
         }
         return load;
@@ -333,11 +333,11 @@
             double dens = density.getDensity(km, year);
             SedimentLoadFraction fraction = load.getFraction(km);
             double coarse = fraction.getCoarse();
-            double fineMiddle = fraction.getFine_middle();
+            double fineMiddle = fraction.getFineMiddle();
             double sand = fraction.getSand();
-            double suspSand = fraction.getSusp_sand();
-            double bedSand = fraction.getSusp_sand_bed();
-            double sediment = fraction.getSusp_sediment();
+            double suspSand = fraction.getSuspSand();
+            double bedSand = fraction.getSuspSandBed();
+            double sediment = fraction.getSuspSediment();
             double total = fraction.getTotal();
             load.setCoarse(km, (coarse * dens), fraction.getCoarseRange());
             load.setFineMiddle(km, (fineMiddle * dens), fraction.getFineMiddleRange());
diff -r 2f39cf68a1dd -r 8d6f23243d1d artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFraction.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFraction.java	Thu Jun 20 10:09:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFraction.java	Thu Jun 20 11:42:47 2013 +0200
@@ -16,11 +16,11 @@
 extends NamedObjectImpl
 {
     double sand;
-    double fine_middle;
+    double fineMiddle;
     double coarse;
-    double susp_sand;
-    double susp_sand_bed;
-    double susp_sediment;
+    double suspSand;
+    double suspSandBed;
+    double suspSediment;
     double loadTotal;
     double total;
     /** Values are valid within this km range. */
@@ -36,11 +36,11 @@
 
     public SedimentLoadFraction() {
         sand = 0d;
-        fine_middle = 0d;
+        fineMiddle = 0d;
         coarse = 0d;
-        susp_sand = 0d;
-        susp_sand_bed = 0d;
-        susp_sediment = 0d;
+        suspSand = 0d;
+        suspSandBed = 0d;
+        suspSediment = 0d;
         loadTotal = 0d;
     }
 
@@ -60,12 +60,12 @@
         return this.sandRange;
     }
 
-    public double getFine_middle() {
-        return fine_middle;
+    public double getFineMiddle() {
+        return fineMiddle;
     }
 
-    public void setFine_middle(double fine_middle) {
-        this.fine_middle = fine_middle;
+    public void setFineMiddle(double fineMiddle) {
+        this.fineMiddle = fineMiddle;
     }
 
     public void setFineMiddleRange(Range range) {
@@ -92,12 +92,12 @@
         this.coarseRange = range;
     }
 
-    public double getSusp_sand() {
-        return susp_sand;
+    public double getSuspSand() {
+        return suspSand;
     }
 
-    public void setSusp_sand(double susp_sand) {
-        this.susp_sand = susp_sand;
+    public void setSuspSand(double suspSand) {
+        this.suspSand = suspSand;
     }
 
     public void setSuspSandRange(Range range) {
@@ -108,12 +108,12 @@
         return this.suspSandRange;
     }
 
-    public double getSusp_sand_bed() {
-        return susp_sand_bed;
+    public double getSuspSandBed() {
+        return suspSandBed;
     }
 
-    public void setSusp_sand_bed(double susp_sand_bed) {
-        this.susp_sand_bed = susp_sand_bed;
+    public void setSuspSandBed(double suspSandBed) {
+        this.suspSandBed = suspSandBed;
     }
 
     public void setSuspSandBedRange(Range range) {
@@ -124,12 +124,12 @@
         return this.suspSandRange;
     }
 
-    public double getSusp_sediment() {
-        return susp_sediment;
+    public double getSuspSediment() {
+        return suspSediment;
     }
 
-    public void setSusp_sediment(double susp_sediment) {
-        this.susp_sediment = susp_sediment;
+    public void setSuspSediment(double suspSediment) {
+        this.suspSediment = suspSediment;
     }
 
     public void setSuspSedimentRange(Range range) {
diff -r 2f39cf68a1dd -r 8d6f23243d1d artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadResult.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadResult.java	Thu Jun 20 10:09:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadResult.java	Thu Jun 20 11:42:47 2013 +0200
@@ -94,9 +94,9 @@
         TDoubleArrayList k = new TDoubleArrayList();
         TDoubleArrayList fm = new TDoubleArrayList();
         for (double km : kms) {
-            if (load.getFraction(km).getFine_middle() > 0d) {
+            if (load.getFraction(km).getFineMiddle() > 0d) {
                 k.add(km);
-                fm.add(load.getFraction(km).getFine_middle());
+                fm.add(load.getFraction(km).getFineMiddle());
             }
         }
         return new double [][] {
@@ -126,9 +126,9 @@
         TDoubleArrayList k = new TDoubleArrayList();
         TDoubleArrayList ss = new TDoubleArrayList();
         for (double km : kms) {
-            if (load.getFraction(km).getSusp_sand() > 0d) {
+            if (load.getFraction(km).getSuspSand() > 0d) {
                 k.add(km);
-                ss.add(load.getFraction(km).getSusp_sand());
+                ss.add(load.getFraction(km).getSuspSand());
             }
         }
         return new double [][] {
@@ -142,9 +142,9 @@
         TDoubleArrayList k = new TDoubleArrayList();
         TDoubleArrayList ss = new TDoubleArrayList();
         for (double km : kms) {
-            if (load.getFraction(km).getSusp_sand_bed() > 0d) {
+            if (load.getFraction(km).getSuspSandBed() > 0d) {
                 k.add(km);
-                ss.add(load.getFraction(km).getSusp_sand_bed());
+                ss.add(load.getFraction(km).getSuspSandBed());
             }
         }
         return new double [][] {
@@ -158,9 +158,9 @@
         TDoubleArrayList k = new TDoubleArrayList();
         TDoubleArrayList ss = new TDoubleArrayList();
         for (double km : kms) {
-            if (load.getFraction(km).getSusp_sediment() > 0d) {
+            if (load.getFraction(km).getSuspSediment() > 0d) {
                 k.add(km);
-                ss.add(load.getFraction(km).getSusp_sediment());
+                ss.add(load.getFraction(km).getSuspSediment());
             }
         }
         return new double [][] {


More information about the Dive4elements-commits mailing list