Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQDay.java @ 385:478940d06876
Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
flys-artifacts/trunk@1802 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 03 May 2011 12:05:32 +0000 |
parents | |
children | 8b0152363bdb 3dc61e00385e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQDay.java Tue May 03 12:05:32 2011 +0000 @@ -0,0 +1,64 @@ +package de.intevation.flys.artifacts.model; + +import java.io.Serializable; + +import gnu.trove.TDoubleArrayList; +import gnu.trove.TIntArrayList; + + +/** + * This class represents a pool of data triples that consists of 'W', 'Q' and + * 'Day' data. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class WQDay implements Serializable { + + protected TIntArrayList days; + + protected TDoubleArrayList ws; + + protected TDoubleArrayList qs; + + + public WQDay() { + days = new TIntArrayList(); + ws = new TDoubleArrayList(); + qs = new TDoubleArrayList(); + } + + + public WQDay(int capacity) { + days = new TIntArrayList(capacity); + ws = new TDoubleArrayList(capacity); + qs = new TDoubleArrayList(capacity); + } + + + public void add(int day, double w, double q) { + days.add(day); + ws.add(w); + qs.add(q); + } + + + public int size() { + return days.size(); + } + + + public int getDay(int idx) { + return days.get(idx); + } + + + public double getW(int idx) { + return ws.get(idx); + } + + + public double getQ(int idx) { + return qs.get(idx); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :