Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QKmsImpl.java @ 4822:4ec9d7931b13
insert new helpTexts, delete helpText for Transition
author | Bettina Gruenbauer <bettina@intevation.de> |
---|---|
date | Mon, 21 Jan 2013 15:55:08 +0100 |
parents | 4d457c68b1d3 |
children | bcf25d8c183e |
rev | line source |
---|---|
4817
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 import gnu.trove.TDoubleArrayList; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 public class QKmsImpl |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 extends NamedObjectImpl |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 implements QKms |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 protected TDoubleArrayList kms; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 protected TDoubleArrayList qs; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 public QKmsImpl() { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 super(""); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
14 kms = new TDoubleArrayList(); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 qs = new TDoubleArrayList(); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
17 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
18 public QKmsImpl(String name) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
19 super(name); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
20 kms = new TDoubleArrayList(); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
21 qs = new TDoubleArrayList(); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
22 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
24 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
25 public QKmsImpl(int capacity) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
26 super(""); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
27 kms = new TDoubleArrayList(capacity); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
28 qs = new TDoubleArrayList(capacity); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
29 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
30 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
31 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
32 public QKmsImpl(TDoubleArrayList kms, TDoubleArrayList qs) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
33 this(kms, qs, ""); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
34 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
35 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
36 public QKmsImpl( |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
37 TDoubleArrayList kms, |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
38 TDoubleArrayList qs, |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
39 String name |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
40 ) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
41 super(name); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
42 this.kms = kms; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
43 this.qs = qs; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
44 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
45 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
46 public void add(double km, double q) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
47 kms.add(km); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
48 qs .add(q); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
49 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
50 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
51 @Override |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
52 public double getQ(int index) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
53 return qs.getQuick(index); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
54 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
55 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
56 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
57 @Override |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
58 public double getKm(int index) { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
59 return kms.getQuick(index); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
60 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
61 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
62 @Override |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
63 public int size() { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
64 return kms.size(); |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
65 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
66 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
67 @Override |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
68 public TDoubleArrayList allKms() { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
69 return kms; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
70 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
71 |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
72 @Override |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
73 public TDoubleArrayList allQs() { |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
74 return qs; |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
75 } |
4d457c68b1d3
Added QKms model.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
76 } |