view artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterResult.java @ 8098:09725b65955a

Add new and simplyfied SedimentLoadFacet The SedimentLoadFacet is intended to work with the Measurement stations. It uses the same mechanismn to access the Mesurement station values as the calculation does. SedimentLoadLS values need a different facet that will come soon.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 15 Aug 2014 18:27:19 +0200
parents af13ceeba52a
children 073ea4bcea58
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
 * Software engineering by Intevation GmbH
 *
 * 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.model.minfo;

import gnu.trove.TDoubleArrayList;


public class BedDiameterResult
extends BedQualityDiameterResult
{
    protected TDoubleArrayList diameterCap;
    protected TDoubleArrayList diameterSub;

    public BedDiameterResult (
        String type,
        TDoubleArrayList diameterCap,
        TDoubleArrayList diameterSub,
        TDoubleArrayList km
    ) {
        super(type, km);
        this.diameterCap = diameterCap;
        this.diameterSub = diameterSub;
    }

    public double getDiameterCap(int ndx) {
        if (diameterCap != null) {
            return this.diameterCap.get(ndx);
        }
        return Double.NaN;
    }

    public double getDiameterSub(int ndx) {
        if (diameterSub != null) {
            return this.diameterSub.get(ndx);
        }
        return Double.NaN;
    }

    public double getDiameterCap(double km) {
        if (kms.indexOf(km) >= 0) {
            return diameterCap.get(kms.indexOf(km));
        }
        return Double.NaN;
    }

    public double getDiameterSub(double km) {
        if (kms.indexOf(km) >= 0) {
            return diameterSub.get(kms.indexOf(km));
        }
        return Double.NaN;
    }

    public double[][] getDiameterCapData() {
        return new double[][] {
            kms.toNativeArray(),
            diameterCap.toNativeArray()
        };
    }

    public double[][] getDiameterSubData() {
        return new double[][] {
            kms.toNativeArray(),
            diameterSub.toNativeArray()
        };
    }
}

http://dive4elements.wald.intevation.org