Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java @ 2182:5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
flys-artifacts/trunk@3786 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 27 Jan 2012 10:45:34 +0000 |
parents | |
children | ec2574eb2d32 |
comparison
equal
deleted
inserted
replaced
2181:38207b820dca | 2182:5ff481ab24a1 |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import gnu.trove.TDoubleArrayList; | |
4 | |
5 public class WW | |
6 extends W | |
7 { | |
8 protected TDoubleArrayList ws2; | |
9 | |
10 public WW() { | |
11 } | |
12 | |
13 public WW(String name) { | |
14 super(name); | |
15 } | |
16 | |
17 public WW(int capacity) { | |
18 this(capacity, ""); | |
19 } | |
20 | |
21 public WW(int capacity, String name) { | |
22 super(capacity, name); | |
23 ws2 = new TDoubleArrayList(capacity); | |
24 } | |
25 | |
26 public void add(double w1, double w2) { | |
27 ws .add(w1); | |
28 ws2.add(w2); | |
29 } | |
30 | |
31 public double getW2(int idx) { | |
32 return ws2.getQuick(idx); | |
33 } | |
34 | |
35 public double [] getWs2() { | |
36 return ws2.toNativeArray(); | |
37 } | |
38 | |
39 @Override | |
40 public double [] get(int idx) { | |
41 return get(idx, new double[2]); | |
42 } | |
43 | |
44 @Override | |
45 public double [] get(int idx, double [] dst) { | |
46 dst[0] = ws .getQuick(idx); | |
47 dst[1] = ws2.getQuick(idx); | |
48 return dst; | |
49 } | |
50 | |
51 @Override | |
52 public void removeNaNs() { | |
53 removeNaNs(new TDoubleArrayList [] { ws, ws2 }); | |
54 } | |
55 } | |
56 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |