view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculationResult.java @ 8980:b194fa64506a

SINFO - show results themes according to spec, either raw data or floating mean values. Some improvements to error handling and handling of empty results.
author gernotbelger
date Thu, 05 Apr 2018 18:30:34 +0200
parents b0aeed4c97c1
children 0adc6d04de95
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.flowdepthminmax;

import java.util.Collection;

import org.dive4elements.river.artifacts.sinfo.common.AbstractSInfoCalculationResult;
import org.dive4elements.river.artifacts.sinfo.common.SInfoResultRow;
import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo;
import org.dive4elements.river.artifacts.sinfo.util.WstInfo;

/**
 * Contains the results of a {@link FlowDepthCalculation}.
 *
 * @author Gernot Belger
 */
final class FlowDepthMinMaxCalculationResult extends AbstractSInfoCalculationResult {

    private static final long serialVersionUID = 1L;

    private final BedHeightInfo minSounding;

    private final BedHeightInfo maxSounding;

    public FlowDepthMinMaxCalculationResult(final String label, final WstInfo wst, final BedHeightInfo minSounding, final BedHeightInfo maxSounding,
            final Collection<SInfoResultRow> rows) {
        super(label, wst, rows);

        this.minSounding = minSounding;
        this.maxSounding = maxSounding;
    }

    public BedHeightInfo getMinSounding() {
        return this.minSounding;
    }

    public BedHeightInfo getMaxSounding() {
        return this.maxSounding;
    }

    public BedHeightInfo getAnySounding() {
        if (this.minSounding != null)
            return this.minSounding;

        return this.maxSounding;
    }

    public boolean hasMin() {
        return this.minSounding != null;
    }

    public boolean hasMax() {
        return this.maxSounding != null;
    }
}

http://dive4elements.wald.intevation.org