comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedQualityResult.java @ 3763:55fe9c1dc6f3

Updated minfo bed quality result objects. flys-artifacts/trunk@5465 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 14 Sep 2012 07:45:01 +0000
parents 312870fded7e
children d29cebf371ba
comparison
equal deleted inserted replaced
3762:0c978a80726a 3763:55fe9c1dc6f3
1 package de.intevation.flys.artifacts.model.minfo; 1 package de.intevation.flys.artifacts.model.minfo;
2
3 import gnu.trove.TDoubleArrayList;
2 4
3 import java.io.Serializable; 5 import java.io.Serializable;
4 6
5 import de.intevation.flys.artifacts.model.DateRange; 7 import de.intevation.flys.artifacts.model.DateRange;
6 8
23 DMIN, 25 DMIN,
24 DMAX 26 DMAX
25 } 27 }
26 28
27 protected DIAMETER_TYPE type; 29 protected DIAMETER_TYPE type;
28 protected double diameter; 30 protected TDoubleArrayList diameter;
29 protected double km; 31 protected TDoubleArrayList kms;
30 protected DateRange dateRange; 32 protected DateRange dateRange;
33 protected boolean empty;
31 34
32 public BedQualityResult () { 35 public BedQualityResult () {
36 empty = true;
33 } 37 }
34 38
35 public BedQualityResult ( 39 public BedQualityResult (
36 DIAMETER_TYPE type, 40 String type,
37 double diameter, 41 TDoubleArrayList diameter,
38 double km, 42 TDoubleArrayList km,
39 DateRange range 43 DateRange range
40 ) { 44 ) {
41 this.type = type; 45 if (km.size() > 0) {
46 empty = false;
47 }
48 this.type = DIAMETER_TYPE.valueOf(type.toUpperCase());
42 this.diameter = diameter; 49 this.diameter = diameter;
43 this.km = km; 50 this.kms = km;
44 this.dateRange = range; 51 this.dateRange = range;
45 } 52 }
46 53
47 public DIAMETER_TYPE getType() { 54 public DIAMETER_TYPE getType() {
48 return this.type; 55 return this.type;
49 } 56 }
50 57
51 public double getKm() { 58 public TDoubleArrayList getKms() {
52 return this.km; 59 return this.kms;
53 } 60 }
54 61
55 public double getDiameter() { 62 public double getDiameter(int ndx) {
56 return this.diameter; 63 if (diameter != null) {
64 return this.diameter.get(ndx);
65 }
66 return Double.NaN;
57 } 67 }
58 68
59 public DateRange getDateRange() { 69 public DateRange getDateRange() {
60 return this.dateRange; 70 return this.dateRange;
61 } 71 }
62 public void setType(DIAMETER_TYPE type) { 72
73 public void setType(DIAMETER_TYPE type) {
63 this.type = type; 74 this.type = type;
64 } 75 }
65 76
66 public void setDiameter(double diameter) { 77 public boolean isEmpty() {
67 this.diameter = diameter; 78 return empty;
68 } 79 }
69
70 public void setKm(double km) {
71 this.km = km;
72 }
73
74 public void setDateRange(DateRange dateRange) {
75 this.dateRange = dateRange;
76 }
77
78 } 80 }

http://dive4elements.wald.intevation.org