comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java @ 2256:dd93a8e1377a

First steps to serve the data in cm if we are are gauges only. flys-artifacts/trunk@3910 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 03 Feb 2012 18:03:26 +0000
parents 9dc81827b187
children 3973a2451cf7
comparison
equal deleted inserted replaced
2255:eab357067e06 2256:dd93a8e1377a
14 protected Function function2; 14 protected Function function2;
15 protected int pos; 15 protected int pos;
16 protected WW ww; 16 protected WW ww;
17 17
18 public ApplyFunctionIterator(WW ww) { 18 public ApplyFunctionIterator(WW ww) {
19 this(ww, Identity.IDENTITY, Identity.IDENTITY);
20 }
21
22 public ApplyFunctionIterator(
23 WW ww,
24 Function function1,
25 Function function2
26 ) {
19 this.ww = ww; 27 this.ww = ww;
20 this.function1 = Identity.IDENTITY; 28 this.function1 = function1;
21 this.function2 = Identity.IDENTITY; 29 this.function2 = function2;
22 } 30 }
23 31
24 public boolean hasNext() { 32 public boolean hasNext() {
25 return pos < ww.size(); 33 return pos < ww.size();
26 } 34 }
50 protected TDoubleArrayList ws2; 58 protected TDoubleArrayList ws2;
51 59
52 protected double startKm; 60 protected double startKm;
53 protected double endKm; 61 protected double endKm;
54 62
63 protected Double startDatum;
64 protected Double endDatum;
65
55 public WW() { 66 public WW() {
56 } 67 }
57 68
58 public WW(String name) { 69 public WW(String name) {
59 super(name); 70 super(name);
68 ws2 = new TDoubleArrayList(capacity); 79 ws2 = new TDoubleArrayList(capacity);
69 } 80 }
70 81
71 public WW( 82 public WW(
72 String name, 83 String name,
73 double startKm, 84 double startKm,
85 Double startDatum,
74 double [] ws, 86 double [] ws,
75 double endKm, 87 double endKm,
88 Double endDatum,
76 double [] ws2 89 double [] ws2
77 ) { 90 ) {
78 this.name = name; 91 this.name = name;
79 this.ws = new TDoubleArrayList(ws); 92 this.ws = new TDoubleArrayList(ws);
80 this.ws2 = new TDoubleArrayList(ws2); 93 this.ws2 = new TDoubleArrayList(ws2);
81 this.startKm = startKm; 94 this.startKm = startKm;
82 this.endKm = endKm; 95 this.startDatum = startDatum;
96 this.endKm = endKm;
97 this.endDatum = endDatum;
83 } 98 }
84 99
85 public WW(String name, TDoubleArrayList ws, TDoubleArrayList ws2) { 100 public WW(String name, TDoubleArrayList ws, TDoubleArrayList ws2) {
86 this.name = name; 101 this.name = name;
87 this.ws = ws; 102 this.ws = ws;
131 146
132 public void setEndKm(double endKm) { 147 public void setEndKm(double endKm) {
133 this.endKm = endKm; 148 this.endKm = endKm;
134 } 149 }
135 150
151 public Double getStartDatum() {
152 return startDatum;
153 }
154
155 public boolean startAtGauge() {
156 return startDatum != null;
157 }
158
159 public boolean endAtGauge() {
160 return endDatum != null;
161 }
162
163 public void setStartDatum(Double startDatum) {
164 this.startDatum = startDatum;
165 }
166
167 public Double getEndDatum() {
168 return endDatum;
169 }
170
171 public void setEndDatum(Double endDatum) {
172 this.endDatum = endDatum;
173 }
174
136 @Override 175 @Override
137 public void removeNaNs() { 176 public void removeNaNs() {
138 removeNaNs(new TDoubleArrayList [] { ws, ws2 }); 177 removeNaNs(new TDoubleArrayList [] { ws, ws2 });
139 } 178 }
140 179

http://dive4elements.wald.intevation.org