comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java @ 6215:0f5cacdd60a9

I999: Epochs and single years are handled in the same way in difference calc.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 06 Jun 2013 13:28:05 +0200
parents b12ec9f240bc
children 7d86ed4537d9
comparison
equal deleted inserted replaced
6214:467df391317d 6215:0f5cacdd60a9
58 return new CalculationResult(); 58 return new CalculationResult();
59 } 59 }
60 60
61 private CalculationResult internalCalculate() { 61 private CalculationResult internalCalculate() {
62 62
63 if (yearEpoch.equals("year")) { 63 BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length];
64 BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length];
65 64
66 for (int i = 0; i < heightIds.length; i++) { 65 for (int i = 0; i < heightIds.length; i++) {
67 BedHeight [] pair = getHeightPair(heightIds[i], "single"); 66 BedHeight [] pair = getHeightPair(heightIds[i], "single");
68 results[i] = calculateYearDifference(pair); 67 results[i] = calculateYearDifference(pair);
69 }
70 return new CalculationResult(results, this);
71 } 68 }
72 69 return new CalculationResult(results, this);
70 // Currently epochs are handled like single years. To handle epochs
71 // uncomment the follwing code and use an if-clause in the code above.
72 /*
73 if (yearEpoch.equals("epoch")) { 73 if (yearEpoch.equals("epoch")) {
74 BedDiffEpochResult [] results = new BedDiffEpochResult[heightIds.length]; 74 BedDiffEpochResult [] results = new BedDiffEpochResult[heightIds.length];
75 75
76 for (int i = 0; i < heightIds.length; i++) { 76 for (int i = 0; i < heightIds.length; i++) {
77 BedHeight[] pair = getHeightPair(heightIds[i], "epoch"); 77 BedHeight[] pair = getHeightPair(heightIds[i], "epoch");
79 } 79 }
80 return new CalculationResult(results, this); 80 return new CalculationResult(results, this);
81 } 81 }
82 82
83 return new CalculationResult(); 83 return new CalculationResult();
84 */
84 } 85 }
85 86
86 private static BedHeight [] getHeightPair(int [] ids, String type) { 87 private static BedHeight [] getHeightPair(int [] ids, String type) {
87 return new BedHeight [] { 88 return new BedHeight [] {
88 BedHeightFactory.getHeight(type, ids[0], 0), 89 BedHeightFactory.getHeight(type, ids[0], 0),

http://dive4elements.wald.intevation.org