view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/AbstractSInfoCalculationResult.java @ 8946:5d5d482da3e9

Implementing SINFO - FlowDepthMinMax calculation
author gernotbelger
date Tue, 13 Mar 2018 18:49:33 +0100
parents 82998242ba84
children a4f1ac81f26d
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.common;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import org.dive4elements.river.artifacts.sinfo.util.WstInfo;

/**
 * @author Gernot Belger
 */
public abstract class AbstractSInfoCalculationResult<ROW extends AbstractSInfoResultRow> implements Serializable {

    private static final long serialVersionUID = 1L;

    private final Collection<ROW> rows;

    private final String label;

    private final WstInfo wst;

    public AbstractSInfoCalculationResult(final String label, final WstInfo wst, final Collection<ROW> rows) {
        this.label = label;
        this.wst = wst;
        this.rows = new ArrayList<>(rows);
    }

    public final String getLabel() {
        return this.label;
    }

    public final WstInfo getWst() {
        return this.wst;
    }

    public final void addRow(final ROW resultRow) {
        this.rows.add(resultRow);
    }

    public final Collection<ROW> getRows() {
        return Collections.unmodifiableCollection(this.rows);
    }
}

http://dive4elements.wald.intevation.org