comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityData.java @ 3468:f37e7e8907cb

merged flys-artifacts/2.8.1
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:39 +0200
parents 4bd3d8bbb60c
children 10e7bd292c47
comparison
equal deleted inserted replaced
3387:5ffad8bde8ad 3468:f37e7e8907cb
1 package de.intevation.flys.artifacts.model;
2
3 import java.io.Serializable;
4
5 import gnu.trove.TDoubleArrayList;
6
7
8 public class FlowVelocityData implements Serializable {
9
10 private TDoubleArrayList km;
11 private TDoubleArrayList vMain;
12 private TDoubleArrayList vTotal;
13 private TDoubleArrayList tauMain;
14 private TDoubleArrayList q;
15 private String zone;
16
17
18 protected FlowVelocityData() {
19 this.km = new TDoubleArrayList();
20 this.vMain = new TDoubleArrayList();
21 this.vTotal = new TDoubleArrayList();
22 this.tauMain = new TDoubleArrayList();
23 this.q = new TDoubleArrayList();
24 }
25
26
27 public void addKM(double km) {
28 this.km.add(km);
29 }
30
31 public double getKM(int idx) {
32 return km.get(idx);
33 }
34
35 public void addVMain(double vMain) {
36 this.vMain.add(vMain);
37 }
38
39 public double getVMain(int idx) {
40 return vMain.get(idx);
41 }
42
43 public void addVTotal(double vTotal) {
44 this.vTotal.add(vTotal);
45 }
46
47 public double getVTotal(int idx) {
48 return vTotal.get(idx);
49 }
50
51 public void addTauMain(double tauMain) {
52 this.tauMain.add(tauMain);
53 }
54
55 public double getTauMain(int idx) {
56 return tauMain.get(idx);
57 }
58
59 public void addQ(double q) {
60 this.q.add(q);
61 }
62
63 public double getQ(int idx) {
64 return q.get(idx);
65 }
66
67 public void setZone(String zone) {
68 this.zone = zone;
69 }
70
71 public String getZone() {
72 return zone;
73 }
74
75 public int size() {
76 return km.size();
77 }
78
79
80 public double[][] getMainChannelPoints() {
81 double[][] points = new double[2][size()];
82
83 for (int i = 0, n = size(); i < n; i++) {
84 points[0][i] = getKM(i);
85 points[1][i] = getVMain(i);
86 }
87
88 return points;
89 }
90
91
92 public double[][] getTotalChannelPoints() {
93 double[][] points = new double[2][size()];
94
95 for (int i = 0, n = size(); i < n; i++) {
96 points[0][i] = getKM(i);
97 points[1][i] = getVTotal(i);
98 }
99
100 return points;
101 }
102
103
104 public double[][] getTauPoints() {
105 double[][] points = new double[2][size()];
106
107 for (int i = 0, n = size(); i < n; i++) {
108 points[0][i] = getKM(i);
109 points[1][i] = getTauMain(i);
110 }
111
112 return points;
113 }
114 }
115 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org