comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhAccess.java @ 8915:d9dbf0b74bc2

Refaktoring of flow depth calculation, extracting tkh part. First implementation of tkh calculation.
author gernotbelger
date Wed, 28 Feb 2018 17:27:15 +0100
parents
children 611a523fc42f
comparison
equal deleted inserted replaced
8914:e3519c3e7a0a 8915:d9dbf0b74bc2
1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
2 * Software engineering by
3 * Björnsen Beratende Ingenieure GmbH
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
5 *
6 * This file is Free Software under the GNU AGPL (>=v3)
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
8 * documentation coming with Dive4Elements River for details.
9 */
10
11 package org.dive4elements.river.artifacts.sinfo.tkhstate;
12
13 import org.apache.commons.lang.math.DoubleRange;
14 import org.dive4elements.river.artifacts.access.RangeAccess;
15 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
16 import org.dive4elements.river.artifacts.sinfo.SinfoCalcMode;
17
18 /**
19 * Access to the flow depth calculation type specific SInfo artifact data.
20 * REMARK: this class is NOT intended to be hold in the results (or anywhere else), in order to avoid a permanent
21 * reference to the artifact instance.
22 * Hence we do NOT cache any data.
23 *
24 * @author Gernot Belger
25 */
26 final class TkhAccess extends RangeAccess {
27 public TkhAccess(final SINFOArtifact artifact) {
28 super(artifact);
29
30 /* assert calculation mode */
31 final SinfoCalcMode calculationMode = artifact.getCalculationMode();
32 assert (calculationMode == SinfoCalcMode.sinfo_calc_transport_bodies_heights);
33 }
34
35 public DoubleRange getRange() {
36 final double from = getFrom();
37 final double to = getTo();
38 return new DoubleRange(from, to);
39 }
40 }

http://dive4elements.wald.intevation.org