# HG changeset patch
# User Ingo Weinzierl <ingo.weinzierl@intevation.de>
# Date 1304065724 0
# Node ID c13ca9d632d6bd3d1b045aedc1b6be052c28aca5
# Parent  8830eecad69e159763b2879996d94a3a865886ac
Introduced GNU Trove to store WQKms values in a more performant data structure.

flys-artifacts/trunk@1773 c6561f87-3c4e-4783-a992-168aeb5c3f6f

diff -r 8830eecad69e -r c13ca9d632d6 flys-artifacts/ChangeLog
--- a/flys-artifacts/ChangeLog	Fri Apr 29 08:13:56 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Apr 29 08:28:44 2011 +0000
@@ -1,3 +1,12 @@
+2011-04-29  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/WQKms.java: Changed the
+	  data structure to store w, q and kms values from List<Double> to
+	  TDoubleArrayList which stores native double values instead of big
+	  Double values.
+
+	* pom.xml: Added the GNU Trove dependency.
+
 2011-04-29  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/OutGenerator.java: Added the
diff -r 8830eecad69e -r c13ca9d632d6 flys-artifacts/pom.xml
--- a/flys-artifacts/pom.xml	Fri Apr 29 08:13:56 2011 +0000
+++ b/flys-artifacts/pom.xml	Fri Apr 29 08:28:44 2011 +0000
@@ -41,6 +41,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>trove</groupId>
+      <artifactId>trove</artifactId>
+      <version>2.1.1</version>
+    </dependency>
+    <dependency>
       <groupId>de.intevation.bsh.artifact-database</groupId>
       <artifactId>artifact-database</artifactId>
       <version>1.0-SNAPSHOT</version>
diff -r 8830eecad69e -r c13ca9d632d6 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKms.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKms.java	Fri Apr 29 08:13:56 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKms.java	Fri Apr 29 08:28:44 2011 +0000
@@ -1,8 +1,8 @@
 package de.intevation.flys.artifacts.model;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+
+import gnu.trove.TDoubleArrayList;
 
 
 /**
@@ -14,19 +14,19 @@
 public class WQKms implements Serializable {
 
     /** The array that contains the 'W' values.*/
-    protected List<Double> w;
+    protected TDoubleArrayList w;
 
     /** The array that contains the 'Q' values.*/
-    protected List<Double> q;
+    protected TDoubleArrayList q;
 
     /** The array that contains the 'KMs' values.*/
-    protected List<Double> kms;
+    protected TDoubleArrayList kms;
 
 
     public WQKms() {
-        this.w   = new ArrayList<Double>();
-        this.q   = new ArrayList<Double>();
-        this.kms = new ArrayList<Double>();
+        this.w   = new TDoubleArrayList();
+        this.q   = new TDoubleArrayList();
+        this.kms = new TDoubleArrayList();
     }
 
 
@@ -38,9 +38,9 @@
      * @param kms a Kms.
      */
     public void add(double w, double q, double kms) {
-        this.w.add(new Double(w));
-        this.q.add(new Double(q));
-        this.kms.add(new Double(kms));
+        this.w.add(w);
+        this.q.add(q);
+        this.kms.add(kms);
     }