comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelData.java @ 9362:392745cccede

Fixed: waterlevels from database should not get the "Bezugspegel" column in the result output.
author gernotbelger
date Wed, 01 Aug 2018 18:40:57 +0200
parents 45f1ad66560e
children ba1e2e8f05d1
comparison
equal deleted inserted replaced
9361:2aec052d4088 9362:392745cccede
27 private final int year; 27 private final int year;
28 28
29 /** If <code>true</code>, tabular export will show gauges for every station, else only for the first gauge */ 29 /** If <code>true</code>, tabular export will show gauges for every station, else only for the first gauge */
30 private final boolean showAllGauges; 30 private final boolean showAllGauges;
31 31
32 public WaterlevelData(final WKms wkms, final int year) { 32 private boolean showRefGauges;
33 this(wkms, year, false); 33
34 public WaterlevelData(final WKms wkms, final int year, final boolean showAllGauges, boolean showRefGauges) {
35 this(wkms.getName(), wkms, year, showAllGauges, showRefGauges);
34 } 36 }
35 37
36 public WaterlevelData(final WKms wkms, final int year, final boolean showAllGauges) { 38 private WaterlevelData(final String name, final WKms wkms, final int year, final boolean showAllGauges, boolean showRefGauges) {
37 this(wkms.getName(), wkms, year, showAllGauges);
38 }
39
40 private WaterlevelData(final String name, final WKms wkms, final int year, final boolean showAllGauges) {
41 this.name = name; 39 this.name = name;
42 this.wkms = wkms; 40 this.wkms = wkms;
43 this.year = year; 41 this.year = year;
44 this.showAllGauges = showAllGauges; 42 this.showAllGauges = showAllGauges;
43 this.showRefGauges = showRefGauges;
45 } 44 }
46 45
47 public WaterlevelData filterByRange(final double from, final double to) { 46 public WaterlevelData filterByRange(final double from, final double to) {
48 if (Double.isNaN(from) || Double.isNaN(to)) { 47 if (Double.isNaN(from) || Double.isNaN(to)) {
49 return this; 48 return this;
50 } 49 }
51 50
52 final WKms filteredWkms = this.wkms.filteredKms(from, to); 51 final WKms filteredWkms = this.wkms.filteredKms(from, to);
53 return new WaterlevelData(this.name, filteredWkms, this.year, this.showAllGauges); 52 return new WaterlevelData(this.name, filteredWkms, this.year, this.showAllGauges ,showRefGauges);
54 } 53 }
55 54
56 public WaterlevelData withName(final String nameToSet) { 55 public WaterlevelData withName(final String nameToSet) {
57 return new WaterlevelData(nameToSet, this.wkms, this.year, this.showAllGauges); 56 return new WaterlevelData(nameToSet, this.wkms, this.year, this.showAllGauges, showRefGauges);
58 } 57 }
59 58
60 public String getName() { 59 public String getName() {
61 return this.name; 60 return this.name;
62 } 61 }
65 return this.wkms; 64 return this.wkms;
66 } 65 }
67 66
68 public boolean isShowAllGauges() { 67 public boolean isShowAllGauges() {
69 return this.showAllGauges; 68 return this.showAllGauges;
69 }
70
71 public boolean isShowRefGauges() {
72 return this.showRefGauges;
70 } 73 }
71 74
72 public int getYear() { 75 public int getYear() {
73 return this.year; 76 return this.year;
74 } 77 }

http://dive4elements.wald.intevation.org