Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKms.java @ 5308:7712dacc27ab
Avoid NPE if data list is null.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 14 Mar 2013 17:16:15 +0100 |
parents | bcf25d8c183e |
children |
rev | line source |
---|---|
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
4821
bcf25d8c183e
Moved NaN removal code from W to DoubleUtil. Create QKms when calculating the 'Umhuellende'.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4817
diff
changeset
|
3 import de.intevation.flys.utils.DoubleUtil; |
bcf25d8c183e
Moved NaN removal code from W to DoubleUtil. Create QKms when calculating the 'Umhuellende'.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4817
diff
changeset
|
4 |
365
c13ca9d632d6
Introduced GNU Trove to store WQKms values in a more performant data structure.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
361
diff
changeset
|
5 import gnu.trove.TDoubleArrayList; |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
7 import org.apache.log4j.Logger; |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
8 |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 /** |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 * This class represents a pool of data triples that consists of 'W', 'Q' and |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 * 'KM' data. |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 * |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 */ |
742
c09c9e05ecfa
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
726
diff
changeset
|
16 public class WQKms |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
17 extends WQ |
4817
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3269
diff
changeset
|
18 implements WKms, QKms |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
19 { |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
20 private static Logger logger = Logger.getLogger(WQKms.class); |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
21 |
1029
3f3988bb6284
Picky Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
22 /** The array that contains the 'KMs' values. */ |
365
c13ca9d632d6
Introduced GNU Trove to store WQKms values in a more performant data structure.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
361
diff
changeset
|
23 protected TDoubleArrayList kms; |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public WQKms() { |
447
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
27 this(""); |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
28 } |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
29 |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
30 |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
31 public WQKms(String name) { |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
32 super(name); |
365
c13ca9d632d6
Introduced GNU Trove to store WQKms values in a more performant data structure.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
361
diff
changeset
|
33 this.kms = new TDoubleArrayList(); |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 } |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
447
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
36 |
380
5f55047a17e8
Moved expensive allocation of result arrays out of km loop.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
367
diff
changeset
|
37 public WQKms(int capacity) { |
447
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
38 this(capacity, ""); |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
39 } |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
40 |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
41 |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
42 public WQKms(int capacity, String name) { |
2182
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
43 super(capacity, name); |
380
5f55047a17e8
Moved expensive allocation of result arrays out of km loop.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
367
diff
changeset
|
44 this.kms = new TDoubleArrayList(capacity); |
5f55047a17e8
Moved expensive allocation of result arrays out of km loop.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
367
diff
changeset
|
45 } |
5f55047a17e8
Moved expensive allocation of result arrays out of km loop.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
367
diff
changeset
|
46 |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
47 public WQKms(double [] kms, double [] qs, double [] ws) { |
447
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
48 this(kms, qs, ws, ""); |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
49 } |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
50 |
5606ba4139e0
WSTs will now have a header that contains the names of the Ws or Qs that had been defined for the computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
402
diff
changeset
|
51 |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
52 public WQKms(double [] kms, double [] qs, double [] ws, String name) { |
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
53 super(qs, ws, name); |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
54 this.kms = new TDoubleArrayList(kms); |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
55 } |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
56 |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
57 @Override |
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
58 public void removeNaNs() { |
4821
bcf25d8c183e
Moved NaN removal code from W to DoubleUtil. Create QKms when calculating the 'Umhuellende'.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4817
diff
changeset
|
59 DoubleUtil.removeNaNs(new TDoubleArrayList [] { ws, qs, kms }); |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
60 } |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
61 |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 /** |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 * Adds a new row to this data pool. |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 * |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 * @param w a W. |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 * @param q a Q. |
3269
b2ea89a665bc
Fix issues in 'documentation'.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2182
diff
changeset
|
67 * @param km a kms. |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 */ |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
69 public void add(double w, double q, double km) { |
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
70 super.add(w, q); |
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
71 kms.add(km); |
366
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
72 } |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
73 |
2182
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
74 @Override |
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
75 public double [] get(int idx) { |
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
76 return get(idx, new double [3]); |
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
77 } |
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
78 |
366
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
79 /** |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
80 * This method returns a triple of W, Q and Kms in a single 3dim array. |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
81 * |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
82 * @param idx The position of the triple. |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
83 * @param dst destination array |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
84 * |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
85 * @return a triple of [W, Q, Kms] in dst. |
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
86 */ |
726
cbaa3ca86f2f
Added base class WQ for WQKms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
719
diff
changeset
|
87 @Override |
2182
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
88 public double [] get(int idx, double [] dst) { |
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
89 dst[0] = ws .getQuick(idx); |
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
90 dst[1] = qs .getQuick(idx); |
686
3dc61e00385e
Merged with trunk and introduced hashing of computed values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
447
diff
changeset
|
91 dst[2] = kms.getQuick(idx); |
366
d64339f9f38f
WQKms model: Added a get() method which takes destination array as an argument.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
365
diff
changeset
|
92 return dst; |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
367
0960df8358ec
New method WQKms.size() to retrieve the number of elements in the data pool.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
366
diff
changeset
|
94 |
925
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
742
diff
changeset
|
95 @Override |
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
742
diff
changeset
|
96 public double getKm(int idx) { |
686
3dc61e00385e
Merged with trunk and introduced hashing of computed values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
447
diff
changeset
|
97 return kms.getQuick(idx); |
367
0960df8358ec
New method WQKms.size() to retrieve the number of elements in the data pool.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
366
diff
changeset
|
98 } |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
99 |
1678
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
100 @Override |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
101 public TDoubleArrayList allKms() { |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
102 return kms; |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
103 } |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
104 |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
105 @Override |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
106 public TDoubleArrayList allWs() { |
2182
5ff481ab24a1
Refactored class hierachy to integrate model for W~W.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1678
diff
changeset
|
107 return ws; |
1678
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
108 } |
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1029
diff
changeset
|
109 |
4817
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3269
diff
changeset
|
110 @Override |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3269
diff
changeset
|
111 public TDoubleArrayList allQs() { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3269
diff
changeset
|
112 return qs; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3269
diff
changeset
|
113 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3269
diff
changeset
|
114 |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
115 public double[] getKms() { |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
116 return kms.toNativeArray(); |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
117 } |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
118 |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
119 /** |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
120 * Returns a string that consist of the first and last kilometer. |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
121 * |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
122 * @return a string that consist of the first and last kilometer. |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
123 */ |
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
124 public String toString() { |
925
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
742
diff
changeset
|
125 double from = getKm(0); |
0cb1a70b8b92
Added the math needed to calculate "W-Differenzen" in "Laengsschnitten"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
742
diff
changeset
|
126 double to = getKm(size()-1); |
686
3dc61e00385e
Merged with trunk and introduced hashing of computed values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
447
diff
changeset
|
127 return from + " - " + to; |
402
eb22ffe4d74c
Implemented methods to retrieve and compute the data used to create discharge longitudinal sections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
380
diff
changeset
|
128 } |
361
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 } |
3e3ec9613883
Introduced a model class to store a set of triple data objects that consist of W, Q and Kms information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |