sascha@2182: package de.intevation.flys.artifacts.model; sascha@2182: sascha@2182: import gnu.trove.TDoubleArrayList; sascha@2182: sascha@2182: public class WW sascha@2182: extends W sascha@2182: { sascha@2182: protected TDoubleArrayList ws2; sascha@2182: sascha@2182: public WW() { sascha@2182: } sascha@2182: sascha@2182: public WW(String name) { sascha@2182: super(name); sascha@2182: } sascha@2182: sascha@2182: public WW(int capacity) { sascha@2182: this(capacity, ""); sascha@2182: } sascha@2182: sascha@2182: public WW(int capacity, String name) { sascha@2182: super(capacity, name); sascha@2182: ws2 = new TDoubleArrayList(capacity); sascha@2182: } sascha@2182: sascha@2186: public WW(String name, double [] ws, double [] ws2) { sascha@2186: this.name = name; sascha@2186: this.ws = new TDoubleArrayList(ws); sascha@2186: this.ws2 = new TDoubleArrayList(ws2); sascha@2186: } sascha@2186: sascha@2182: public void add(double w1, double w2) { sascha@2182: ws .add(w1); sascha@2182: ws2.add(w2); sascha@2182: } sascha@2182: sascha@2182: public double getW2(int idx) { sascha@2182: return ws2.getQuick(idx); sascha@2182: } sascha@2182: sascha@2182: public double [] getWs2() { sascha@2182: return ws2.toNativeArray(); sascha@2182: } sascha@2182: sascha@2182: @Override sascha@2182: public double [] get(int idx) { sascha@2182: return get(idx, new double[2]); sascha@2182: } sascha@2182: sascha@2182: @Override sascha@2182: public double [] get(int idx, double [] dst) { sascha@2182: dst[0] = ws .getQuick(idx); sascha@2182: dst[1] = ws2.getQuick(idx); sascha@2182: return dst; sascha@2182: } sascha@2182: sascha@2182: @Override sascha@2182: public void removeNaNs() { sascha@2182: removeNaNs(new TDoubleArrayList [] { ws, ws2 }); sascha@2182: } sascha@2182: } sascha@2182: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :