view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java @ 2193:73490b828a90

Manual Point Theming improved. flys-artifacts/trunk@3804 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 27 Jan 2012 14:21:51 +0000
parents ec2574eb2d32
children 5781847433d8
line wrap: on
line source
package de.intevation.flys.artifacts.model;

import gnu.trove.TDoubleArrayList;

public class WW
extends      W
{
    protected TDoubleArrayList ws2;

    public WW() {
    }

    public WW(String name) {
        super(name);
    }

    public WW(int capacity) {
        this(capacity, "");
    }

    public WW(int capacity, String name) {
        super(capacity, name);
        ws2 = new TDoubleArrayList(capacity);
    }

    public WW(String name, double [] ws, double [] ws2) {
        this.name = name;
        this.ws  = new TDoubleArrayList(ws);
        this.ws2 = new TDoubleArrayList(ws2);
    }

    public void add(double w1, double w2) {
        ws .add(w1);
        ws2.add(w2);
    }

    public double getW2(int idx) {
        return ws2.getQuick(idx);
    }

    public double [] getWs2() {
        return ws2.toNativeArray();
    }

    @Override
    public double [] get(int idx) {
        return get(idx, new double[2]);
    }

    @Override
    public double [] get(int idx, double [] dst) {
        dst[0] = ws .getQuick(idx);
        dst[1] = ws2.getQuick(idx);
        return dst;
    }

    @Override
    public void removeNaNs() {
        removeNaNs(new TDoubleArrayList [] { ws, ws2 });
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org