comparison 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
comparison
equal deleted inserted replaced
384:88614ddfc1e3 385:478940d06876
1 package de.intevation.flys.artifacts.model;
2
3 import java.io.Serializable;
4
5 import gnu.trove.TDoubleArrayList;
6 import gnu.trove.TIntArrayList;
7
8
9 /**
10 * This class represents a pool of data triples that consists of 'W', 'Q' and
11 * 'Day' data.
12 *
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
14 */
15 public class WQDay implements Serializable {
16
17 protected TIntArrayList days;
18
19 protected TDoubleArrayList ws;
20
21 protected TDoubleArrayList qs;
22
23
24 public WQDay() {
25 days = new TIntArrayList();
26 ws = new TDoubleArrayList();
27 qs = new TDoubleArrayList();
28 }
29
30
31 public WQDay(int capacity) {
32 days = new TIntArrayList(capacity);
33 ws = new TDoubleArrayList(capacity);
34 qs = new TDoubleArrayList(capacity);
35 }
36
37
38 public void add(int day, double w, double q) {
39 days.add(day);
40 ws.add(w);
41 qs.add(q);
42 }
43
44
45 public int size() {
46 return days.size();
47 }
48
49
50 public int getDay(int idx) {
51 return days.get(idx);
52 }
53
54
55 public double getW(int idx) {
56 return ws.get(idx);
57 }
58
59
60 public double getQ(int idx) {
61 return qs.get(idx);
62 }
63 }
64 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org