comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKms.java @ 365:c13ca9d632d6

Introduced GNU Trove to store WQKms values in a more performant data structure. flys-artifacts/trunk@1773 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 29 Apr 2011 08:28:44 +0000
parents 3e3ec9613883
children d64339f9f38f
comparison
equal deleted inserted replaced
364:8830eecad69e 365:c13ca9d632d6
1 package de.intevation.flys.artifacts.model; 1 package de.intevation.flys.artifacts.model;
2 2
3 import java.io.Serializable; 3 import java.io.Serializable;
4 import java.util.ArrayList; 4
5 import java.util.List; 5 import gnu.trove.TDoubleArrayList;
6 6
7 7
8 /** 8 /**
9 * This class represents a pool of data triples that consists of 'W', 'Q' and 9 * This class represents a pool of data triples that consists of 'W', 'Q' and
10 * 'KM' data. 10 * 'KM' data.
12 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 12 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
13 */ 13 */
14 public class WQKms implements Serializable { 14 public class WQKms implements Serializable {
15 15
16 /** The array that contains the 'W' values.*/ 16 /** The array that contains the 'W' values.*/
17 protected List<Double> w; 17 protected TDoubleArrayList w;
18 18
19 /** The array that contains the 'Q' values.*/ 19 /** The array that contains the 'Q' values.*/
20 protected List<Double> q; 20 protected TDoubleArrayList q;
21 21
22 /** The array that contains the 'KMs' values.*/ 22 /** The array that contains the 'KMs' values.*/
23 protected List<Double> kms; 23 protected TDoubleArrayList kms;
24 24
25 25
26 public WQKms() { 26 public WQKms() {
27 this.w = new ArrayList<Double>(); 27 this.w = new TDoubleArrayList();
28 this.q = new ArrayList<Double>(); 28 this.q = new TDoubleArrayList();
29 this.kms = new ArrayList<Double>(); 29 this.kms = new TDoubleArrayList();
30 } 30 }
31 31
32 32
33 /** 33 /**
34 * Adds a new row to this data pool. 34 * Adds a new row to this data pool.
36 * @param w a W. 36 * @param w a W.
37 * @param q a Q. 37 * @param q a Q.
38 * @param kms a Kms. 38 * @param kms a Kms.
39 */ 39 */
40 public void add(double w, double q, double kms) { 40 public void add(double w, double q, double kms) {
41 this.w.add(new Double(w)); 41 this.w.add(w);
42 this.q.add(new Double(q)); 42 this.q.add(q);
43 this.kms.add(new Double(kms)); 43 this.kms.add(kms);
44 } 44 }
45 45
46 46
47 /** 47 /**
48 * This method returns a triple of W, Q and Kms in a single 3dim array. 48 * This method returns a triple of W, Q and Kms in a single 3dim array.

http://dive4elements.wald.intevation.org