Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQResult.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQResult.java@bd047b71ab37 |
children | 4897a58c8746 |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.artifacts.model.sq; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 | |
6 | |
7 public class SQResult implements Serializable { | |
8 | |
9 public static final int NUMBER_FRACTIONS = 6; | |
10 | |
11 public static final int FRACTION_A = 0; | |
12 public static final int FRACTION_B = 1; | |
13 public static final int FRACTION_C = 2; | |
14 public static final int FRACTION_D = 3; | |
15 public static final int FRACTION_E = 4; | |
16 public static final int FRACTION_F = 5; | |
17 | |
18 protected double km; | |
19 protected SQFractionResult[] fractions; | |
20 | |
21 public SQResult() { | |
22 this(0d, new SQFractionResult[NUMBER_FRACTIONS]); | |
23 } | |
24 | |
25 public SQResult(double km, SQFractionResult [] fractions) { | |
26 this.km = km; | |
27 this.fractions = fractions; | |
28 } | |
29 | |
30 public SQFractionResult getFraction(int idx) { | |
31 return idx >= 0 && idx < fractions.length | |
32 ? fractions[idx] | |
33 : null; | |
34 } | |
35 | |
36 public void setFraction(int idx, SQFractionResult fraction) { | |
37 if (idx >= 0 && idx < fractions.length) { | |
38 this.fractions[idx] = fraction; | |
39 } | |
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 } | |
59 } | |
60 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |