comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/SQResult.java @ 3392:56f62b5209f5

S/Q relation: Write parameters as export result. flys-artifacts/trunk@5020 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 16 Jul 2012 18:26:00 +0000
parents 79c8e0d9fdea
children
comparison
equal deleted inserted replaced
3391:2b3c4abe034f 3392:56f62b5209f5
13 public static final int FRACTION_C = 2; 13 public static final int FRACTION_C = 2;
14 public static final int FRACTION_D = 3; 14 public static final int FRACTION_D = 3;
15 public static final int FRACTION_E = 4; 15 public static final int FRACTION_E = 4;
16 public static final int FRACTION_F = 5; 16 public static final int FRACTION_F = 5;
17 17
18 protected double km;
18 protected SQFractionResult[] fractions; 19 protected SQFractionResult[] fractions;
19 20
20 public SQResult() { 21 public SQResult() {
21 this(new SQFractionResult[NUMBER_FRACTIONS]); 22 this(0d, new SQFractionResult[NUMBER_FRACTIONS]);
22 } 23 }
23 24
24 public SQResult(SQFractionResult [] fractions) { 25 public SQResult(double km, SQFractionResult [] fractions) {
26 this.km = km;
25 this.fractions = fractions; 27 this.fractions = fractions;
26 } 28 }
27 29
28 public SQFractionResult getFraction(int idx) { 30 public SQFractionResult getFraction(int idx) {
29 return idx >= 0 && idx < fractions.length 31 return idx >= 0 && idx < fractions.length
34 public void setFraction(int idx, SQFractionResult fraction) { 36 public void setFraction(int idx, SQFractionResult fraction) {
35 if (idx >= 0 && idx < fractions.length) { 37 if (idx >= 0 && idx < fractions.length) {
36 this.fractions[idx] = fraction; 38 this.fractions[idx] = fraction;
37 } 39 }
38 } 40 }
41
42 public static final String [] FRACTION_NAMES = {
43 "A", "B", "C", "D", "E", "F"
44 };
45
46 public String getFractionName(int idx) {
47 return idx >= 0 && idx < FRACTION_NAMES.length
48 ? FRACTION_NAMES[idx]
49 : "";
50 }
51
52 public double getKm() {
53 return km;
54 }
55
56 public void setKm(double km) {
57 this.km = km;
58 }
39 } 59 }
40 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 60 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org