Mercurial > dive4elements > river
changeset 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 | 8830eecad69e |
children | d64339f9f38f |
files | flys-artifacts/ChangeLog flys-artifacts/pom.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKms.java |
diffstat | 3 files changed, 25 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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>
--- 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); }