Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineAccess.java @ 9062:5198066492a9
Teilabschnitt Salix State
author | gernotbelger |
---|---|
date | Mon, 07 May 2018 17:25:53 +0200 |
parents | |
children | a5cf8d7bff3c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineAccess.java Mon May 07 17:25:53 2018 +0200 @@ -0,0 +1,45 @@ +/* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde + * Software engineering by + * Björnsen Beratende Ingenieure GmbH + * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.artifacts.uinfo.salix; + +import org.apache.commons.lang.math.DoubleRange; +import org.dive4elements.river.artifacts.access.RangeAccess; +import org.dive4elements.river.artifacts.uinfo.UINFOArtifact; +import org.dive4elements.river.artifacts.uinfo.UinfoCalcMode; + +/** + * Access to the flow depth calculation type specific SInfo artifact data. + * REMARK: this class is NOT intended to be hold in the results (or anywhere else), in order to avoid a permanent + * reference to the artifact instance. + * Hence we do NOT cache any data. + * + * @author Gernot Belger + */ +final class SalixLineAccess extends RangeAccess { + + static final String FIELD_DIFFID_CURRENT = "diffid_current"; + static final String FIELD_DIFFID_HIST = "diffid_historical"; + + public SalixLineAccess(final UINFOArtifact artifact) { + super(artifact); + + /* assert calculation mode */ + final UinfoCalcMode calculationMode = artifact.getCalculationMode(); + assert (calculationMode == UinfoCalcMode.uinfo_salix_line); + } + + public DoubleRange getRange() { + final double from = getFrom(); + final double to = getTo(); + return new DoubleRange(from, to); + } + +} \ No newline at end of file