Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java @ 9573:b9c87bbff6a4
mean bed height -> mean bed LEVEL
author | gernotbelger |
---|---|
date | Tue, 06 Nov 2018 10:56:22 +0100 |
parents | 55c187a0a31e |
children |
comparison
equal
deleted
inserted
replaced
9572:0d0c8fd1b8c8 | 9573:b9c87bbff6a4 |
---|---|
175 | 175 |
176 for (final Double stationDbl : allStations) { | 176 for (final Double stationDbl : allStations) { |
177 | 177 |
178 final double station = stationDbl; | 178 final double station = stationDbl; |
179 | 179 |
180 /* find the right calculator (i.e. bed height) depending on station, there should only be one maximal */ | 180 /* find the right calculator (i.e. bed level) depending on station, there should only be one maximal */ |
181 final TkhCalculator tkhCalculator = findCalculator(calculatorsByRanges, station); | 181 final TkhCalculator tkhCalculator = findCalculator(calculatorsByRanges, station); |
182 if (tkhCalculator == null) | 182 if (tkhCalculator == null) |
183 continue; | 183 continue; |
184 | 184 |
185 final ResultRow row = ResultRow.create(); | 185 final ResultRow row = ResultRow.create(); |
196 return new TkhCalculationResult(waterlevelLabel, wstInfo, true, rows); | 196 return new TkhCalculationResult(waterlevelLabel, wstInfo, true, rows); |
197 } | 197 } |
198 | 198 |
199 private TkhCalculator findCalculator(final Map<NumberRange, TkhCalculator> calculators, final double station) { | 199 private TkhCalculator findCalculator(final Map<NumberRange, TkhCalculator> calculators, final double station) { |
200 | 200 |
201 // REMAKR: linear search at this point, put we expect the number of bed heights to be very small (1-2 items) | 201 // REMAKR: linear search at this point, put we expect the number of bed levels to be very small (1-2 items) |
202 final Set<Entry<NumberRange, TkhCalculator>> x = calculators.entrySet(); | 202 final Set<Entry<NumberRange, TkhCalculator>> x = calculators.entrySet(); |
203 for (final Entry<NumberRange, TkhCalculator> entry : x) { | 203 for (final Entry<NumberRange, TkhCalculator> entry : x) { |
204 final NumberRange range = entry.getKey(); | 204 final NumberRange range = entry.getKey(); |
205 // FIXME: check if we need comparison with a tolerance | 205 // FIXME: check if we need comparison with a tolerance |
206 if (range.containsDouble(station)) | 206 if (range.containsDouble(station)) |