comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/FlowVelocityData.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/FlowVelocityData.java@bd047b71ab37
children 4897a58c8746
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.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 private String type;
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 void setType(String type) {
76 this.type = type;
77 }
78
79 public String getType() {
80 return this.type;
81 }
82
83 public int size() {
84 return km.size();
85 }
86
87
88 public double[][] getMainChannelPoints() {
89 double[][] points = new double[2][size()];
90
91 for (int i = 0, n = size(); i < n; i++) {
92 points[0][i] = getKM(i);
93 points[1][i] = getVMain(i);
94 }
95
96 return points;
97 }
98
99
100 public double[][] getTotalChannelPoints() {
101 double[][] points = new double[2][size()];
102
103 for (int i = 0, n = size(); i < n; i++) {
104 points[0][i] = getKM(i);
105 points[1][i] = getVTotal(i);
106 }
107
108 return points;
109 }
110
111
112 public double[][] getQPoints() {
113 double[][] points = new double[2][size()];
114
115 for (int i = 0, n = size(); i < n; i++) {
116 points[0][i] = getKM(i);
117 points[1][i] = getQ(i);
118 }
119
120 return points;
121 }
122
123
124 public double[][] getTauPoints() {
125 double[][] points = new double[2][size()];
126
127 for (int i = 0, n = size(); i < n; i++) {
128 points[0][i] = getKM(i);
129 points[1][i] = getTauMain(i);
130 }
131
132 return points;
133 }
134 }
135 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org