view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationAccess.java @ 9398:929d645691ae

Fixed: sinfo flood duration: no w/q problem report with unchecked wspl option
author mschaefer
date Mon, 13 Aug 2018 17:27:52 +0200
parents 0dcd1cd41915
children 02ca823ec9c6
line wrap: on
line source
/* 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.sinfo.flood_duration;

import org.apache.log4j.Logger;
import org.dive4elements.river.artifacts.access.RangeAccess;
import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
import org.dive4elements.river.artifacts.sinfo.SinfoCalcMode;
import org.dive4elements.river.artifacts.sinfo.flood_duration.RiversideRadioChoice.RiversideChoiceKey;

/**
 * Access to the flood duration 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 FloodDurationAccess extends RangeAccess {

    private static Logger log = Logger.getLogger(FloodDurationAccess.class);

    public FloodDurationAccess(final SINFOArtifact artifact) {
        super(artifact);

        /* assert calculation mode */
        final SinfoCalcMode calculationMode = artifact.getCalculationMode();
        assert (calculationMode == SinfoCalcMode.sinfo_calc_flood_duration);
    }

    @Override
    public Double getStep() {
        return super.getStep();
    }

    public RiversideChoiceKey getRiverside() {
        return RiversideChoiceKey.fromKey(super.getString("riverside"));
    }

    public boolean getIsWspl() {
        return super.getBoolean("wspl").booleanValue();
    }
}

http://dive4elements.wald.intevation.org