view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsImpl.java @ 1729:2e5ebdeb8af9

Give StaticWKmsArtifacts proper names, and pre-deselect them. flys-artifacts/trunk@3013 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 18 Oct 2011 15:00:43 +0000
parents fa932d618989
children 65ff8ff20be4
line wrap: on
line source
package de.intevation.flys.artifacts.model;

import gnu.trove.TDoubleArrayList;

public class WKmsImpl
extends      NamedObjectImpl
implements   WKms
{
    protected TDoubleArrayList kms;
    protected TDoubleArrayList ws;

    public WKmsImpl() {
        super("");
        kms = new TDoubleArrayList();
        ws  = new TDoubleArrayList();
    }


    /**
     * Create named, empty WKms.
     */
    public WKmsImpl(String name) {
        super(name);
        kms = new TDoubleArrayList();
        ws  = new TDoubleArrayList();
    }


    public WKmsImpl(int capacity) {
        super("");
        kms = new TDoubleArrayList(capacity);
        ws  = new TDoubleArrayList(capacity);
    }


    public WKmsImpl(TDoubleArrayList kms, TDoubleArrayList ws) {
        this(kms, ws, "");
    }


    public WKmsImpl(
        TDoubleArrayList kms,
        TDoubleArrayList ws,
        String           name
    ) {
        super(name);
        this.kms = kms;
        this.ws  = ws;
    }


    /**
     * Add a W (in NN+m) for a km (in km).
     */
    public void add(double km, double w) {
        kms.add(km);
        ws .add(w);
    }


    @Override
    public double getW(int index) {
        return ws.getQuick(index);
    }


    @Override
    public double getKm(int index) {
        return kms.getQuick(index);
    }


    @Override
    public int size() {
        return kms.size();
    }

    @Override
    public TDoubleArrayList allKms() {
        return kms;
    }

    @Override
    public TDoubleArrayList allWs() {
        return ws;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org