annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Measurements.java @ 4005:22abdc45869c

Calculate S(Q) fractions
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 01 Oct 2012 18:32:27 +0200
parents ab3a4ad82ae1
children f02aa4ff3c0f
rev   line source
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model.sq;
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
3294
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
3 import java.util.ArrayList;
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import java.util.List;
3294
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
5
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
6 import org.apache.log4j.Logger;
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8 public class Measurements
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9 {
3294
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
10 private static final Logger log = Logger.getLogger(Measurements.class);
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
11
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12 public interface SExtractor {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 double getS(Measurement measument);
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 } // interface SExtractor
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 public static final SExtractor S_SF_EXTRACTOR = new SExtractor() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 public double getS(Measurement measument) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 return measument.S_SF();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 };
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 public static final SExtractor S_SS_EXTRACTOR = new SExtractor() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 public double getS(Measurement measument) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 return measument.S_SS();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 };
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 public static final SExtractor S_BL_S_EXTRACTOR = new SExtractor() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 public double getS(Measurement measument) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 return measument.S_BL_S();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 };
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 public static final SExtractor S_BL_FG_EXTRACTOR = new SExtractor() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 public double getS(Measurement measument) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40 return measument.S_BL_FG();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42 };
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 public static final SExtractor S_BL_CG_EXTRACTOR = new SExtractor() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 public double getS(Measurement measument) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 return measument.S_BL_CG();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
49 };
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 public static final SExtractor S_BL_EXTRACTOR = new SExtractor() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53 public double getS(Measurement measument) {
3922
e1d3f6bccf2b S/Q: More symbols in reconstruction of Excel macros.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3294
diff changeset
54 return measument.BL_S();
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
55 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56 };
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 protected List<Measurement> measuments;
4001
ab3a4ad82ae1 S(Q) accumulated same diameter meassurements per bank distance.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3922
diff changeset
59 protected List<Measurement> accumulated;
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
60
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
61 public Measurements() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
62 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
63
4001
ab3a4ad82ae1 S(Q) accumulated same diameter meassurements per bank distance.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3922
diff changeset
64 public Measurements(
ab3a4ad82ae1 S(Q) accumulated same diameter meassurements per bank distance.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3922
diff changeset
65 List<Measurement> measuments,
ab3a4ad82ae1 S(Q) accumulated same diameter meassurements per bank distance.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3922
diff changeset
66 List<Measurement> accumulated
ab3a4ad82ae1 S(Q) accumulated same diameter meassurements per bank distance.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3922
diff changeset
67 ) {
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
68 this.measuments = measuments;
4001
ab3a4ad82ae1 S(Q) accumulated same diameter meassurements per bank distance.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3922
diff changeset
69 this.accumulated = accumulated;
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
70 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
71
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
72 public static List<SQ> extractSQ(
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
73 List<Measurement> measuments,
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
74 SExtractor extractor
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
75 ) {
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
76 List<SQ> result = new ArrayList<SQ>(measuments.size());
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77 for (Measurement measument: measuments) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
78 SQ sq = new SQ(extractor.getS(measument), measument.Q());
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
79 if (sq.isValid()) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
80 result.add(sq);
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
81 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
82 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
83 return result;
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
84 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
85
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
86 public List<SQ> S_SF() {
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
87 return extractSQ(measuments, S_SF_EXTRACTOR);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
88 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
89
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
90 public List<SQ> S_SS() {
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
91 return extractSQ(measuments, S_SS_EXTRACTOR);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
93
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 public List<SQ> S_BL_S() {
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
95 return extractSQ(accumulated, S_BL_S_EXTRACTOR);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98 public List<SQ> S_BL_FG() {
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
99 return extractSQ(accumulated, S_BL_FG_EXTRACTOR);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102 public List<SQ> S_BL_CG() {
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
103 return extractSQ(accumulated, S_BL_CG_EXTRACTOR);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106 public List<SQ> S_BL() {
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
107 return extractSQ(accumulated, S_BL_EXTRACTOR);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 public List<SQ> getSQs(int index) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111 switch (index) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 case 0: return S_SF();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
113 case 1: return S_SS();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114 case 2: return S_BL_S();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
115 case 3: return S_BL_FG();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116 case 4: return S_BL_CG();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 case 5: return S_BL();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
118 }
3294
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
119 log.error("THIS SHOULD NOT HAPPEN: Tried to access SQ[" + index + "]");
5e52202302e5 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3290
diff changeset
120 return new ArrayList<SQ>(0);
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122
4005
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
123 /**
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
124 * Gets the accumulated for this instance.
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
125 *
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
126 * @return The accumulated.
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
127 */
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
128 public List<Measurement> getAccumulated() {
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
129 return this.accumulated;
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
130 }
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
131
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
132 /**
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
133 * Sets the accumulated for this instance.
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
134 *
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
135 * @param accumulated The accumulated.
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
136 */
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
137 public void setAccumulated(List<Measurement> accumulated) {
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
138 this.accumulated = accumulated;
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
139 }
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
140
22abdc45869c Calculate S(Q) fractions
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4001
diff changeset
141
3290
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 @Override
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
143 public String toString() {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
144 StringBuilder sb = new StringBuilder("Measurements [");
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
145 for (int i = 0, M = measuments.size(); i < M; ++i) {
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
146 if (i > 0) sb.append(", ");
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
147 sb.append(measuments.get(i));
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
148 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
149 return sb.append(']').toString();
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
150 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
151 }
36f3b53d5cfc SQ relation: Added infrastructure to extract fractions from measurments.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
152 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org