view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationAccess.java @ 9624:02ca823ec9c6

zu Pos 20 Nachtrag; infrastructureChoice
author dnt_bjoernsen <d.tironi@bjoernsen.de>
date Fri, 11 Oct 2019 18:30:36 +0200
parents 929d645691ae
children
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 java.util.List;

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.InfrastructureServerClientXChange.Element;
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();
    }

    public List<Element> getInfrastructureChoices() {
        return InfrastructureServerClientXChange.parse(super.getString("flood_infrastructure"));
    }
}

http://dive4elements.wald.intevation.org