view artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java @ 6089:0c3301fe23bd

towards issue1061: Store names of original BedHeights in the BedDiffYearResult.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 24 May 2013 11:39:35 +0200
parents af13ceeba52a
children c40acb6bfe38
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 BedDiffYearResult
extends BedDifferencesResult
{

    protected TDoubleArrayList bedHeights;
    protected TDoubleArrayList dataGap;
    protected TDoubleArrayList morphWidth;
    protected int start;
    protected int end;
    protected String nameFirst;
    protected String nameSecond;

    public BedDiffYearResult () {
        super();
        this.bedHeights = new TDoubleArrayList();
        this.dataGap = new TDoubleArrayList();
        this.morphWidth = new TDoubleArrayList();
        this.start = -1;
        this.end = -1;
    }

    public BedDiffYearResult(
        TDoubleArrayList kms,
        TDoubleArrayList differences,
        TDoubleArrayList heights1,
        TDoubleArrayList heights2,
        TDoubleArrayList morphWidth,
        TDoubleArrayList bedHeights,
        TDoubleArrayList dataGap,
        int start,
        int end,
        String nameFirst,
        String nameSecond
    ) {
        super(kms, differences, heights1, heights2);
        this.bedHeights = bedHeights;
        this.dataGap = dataGap;
        this.morphWidth = morphWidth;
        this.start = start;
        this.end = end;
        this.nameFirst = nameFirst;
        this.nameSecond = nameSecond;
    }

    public TDoubleArrayList getBedHeights() {
        return this.bedHeights;
    }

    public TDoubleArrayList getDataGap() {
        return this.dataGap;
    }

    public TDoubleArrayList getMorphWidth() {
        return this.morphWidth;
    }

    public int getStart() {
        return this.start;
    }

    public void setStart(int value) {
        this.start = value;
    }

    public void setEnd(int value) {
        this.end = value;
    }

    public int getEnd() {
        return this.end;
    }

    /** Get name of the first BedHeight (minuend). */
    public String getNameFirst() {
        return this.nameFirst;
    }

    /** Get name of the second BedHeight (subtrahend). */
    public String getNameSecond() {
        return this.nameFirst;
    }

    public void addMorphWidth(double value) {
        this.morphWidth.add(value);
    }

    public void addBedHeights(double value) {
        this.bedHeights.add(value);
    }

    public double[][] getMorphWidthData() {
        return new double[][] {
            kms.toNativeArray(),
            morphWidth.toNativeArray()
        };
    }

    public double[][] getHeightPerYearData() {
        return new double[][] {
            kms.toNativeArray(),
            bedHeights.toNativeArray()
        };
    }
}

http://dive4elements.wald.intevation.org