Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java @ 6966:328854c0467f
SedimentLoadFactory: Further code simplification.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 05 Sep 2013 15:28:59 +0200 |
parents | 69bf96202df4 |
children | 3a987e9af256 |
comparison
equal
deleted
inserted
replaced
6965:69bf96202df4 | 6966:328854c0467f |
---|---|
490 TreeMap<Double, MeasurementStation> stations, | 490 TreeMap<Double, MeasurementStation> stations, |
491 double km | 491 double km |
492 ) { | 492 ) { |
493 MeasurementStation station = stations.get(km); | 493 MeasurementStation station = stations.get(km); |
494 MeasurementStation nextStation = null; | 494 MeasurementStation nextStation = null; |
495 if (station == null) { | |
496 return null; | |
497 } | |
495 if (stations.ceilingEntry(km + 0.1d) != null) { | 498 if (stations.ceilingEntry(km + 0.1d) != null) { |
496 nextStation = stations.ceilingEntry(km + 0.1d).getValue(); | 499 nextStation = stations.ceilingEntry(km + 0.1d).getValue(); |
497 } | 500 } |
498 if (station == null) { | 501 if (nextStation != null) |
499 return null; | 502 return new Range(station.getRange().getA().doubleValue(), |
500 } | 503 nextStation.getRange().getA().doubleValue()); |
501 else { | 504 else { |
502 if (nextStation != null) | 505 // TODO end-of-river instead of B. |
503 return new Range(station.getRange().getA().doubleValue(), | 506 return new Range(station.getRange().getA().doubleValue(), |
504 nextStation.getRange().getA().doubleValue()); | 507 station.getRange().getB().doubleValue()); |
505 else { | |
506 // TODO end-of-river instead of B. | |
507 return new Range(station.getRange().getA().doubleValue(), | |
508 station.getRange().getB().doubleValue()); | |
509 } | |
510 } | 508 } |
511 } | 509 } |
512 | 510 |
513 /** | 511 /** |
514 * Run query with grain parameter set to fraction, feed result into | 512 * Run query with grain parameter set to fraction, feed result into |