Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 443:5d65fe4c08d5
Separated the WST table loading logic from the calculations.
flys-artifacts/trunk@1931 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 17 May 2011 08:55:38 +0000 |
parents | eb22ffe4d74c |
children | 5606ba4139e0 |
comparison
equal
deleted
inserted
replaced
442:c1ef5f63278e | 443:5d65fe4c08d5 |
---|---|
29 import de.intevation.flys.artifacts.model.MainValuesFactory; | 29 import de.intevation.flys.artifacts.model.MainValuesFactory; |
30 import de.intevation.flys.artifacts.model.WQCKms; | 30 import de.intevation.flys.artifacts.model.WQCKms; |
31 import de.intevation.flys.artifacts.model.WQDay; | 31 import de.intevation.flys.artifacts.model.WQDay; |
32 import de.intevation.flys.artifacts.model.WQKms; | 32 import de.intevation.flys.artifacts.model.WQKms; |
33 import de.intevation.flys.artifacts.model.WstValueTable; | 33 import de.intevation.flys.artifacts.model.WstValueTable; |
34 import de.intevation.flys.artifacts.model.WstValueTableFactory; | |
34 | 35 |
35 | 36 |
36 /** | 37 /** |
37 * The default WINFO artifact. | 38 * The default WINFO artifact. |
38 * | 39 * |
257 | 258 |
258 double[] ws = getWs(); | 259 double[] ws = getWs(); |
259 qs = getQsForWs(ws); | 260 qs = getQsForWs(ws); |
260 } | 261 } |
261 | 262 |
262 WstValueTable wst = WstValueTable.getTable(river); | 263 WstValueTable wst = WstValueTableFactory.getTable(river); |
263 if (wst == null) { | 264 if (wst == null) { |
264 throw new NullPointerException("No Wst found for selected river."); | 265 throw new NullPointerException("No Wst found for selected river."); |
265 } | 266 } |
266 | 267 |
267 // TODO Introduce a caching mechanism here! | 268 // TODO Introduce a caching mechanism here! |
334 | 335 |
335 if (locations == null) { | 336 if (locations == null) { |
336 throw new NullPointerException("Cannot determine location."); | 337 throw new NullPointerException("Cannot determine location."); |
337 } | 338 } |
338 | 339 |
339 WstValueTable wst = WstValueTable.getTable(r); | 340 WstValueTable wst = WstValueTableFactory.getTable(r); |
340 if (wst == null) { | 341 if (wst == null) { |
341 throw new NullPointerException("No Wst found for selected river."); | 342 throw new NullPointerException("No Wst found for selected river."); |
342 } | 343 } |
343 | 344 |
344 // TODO Introduce a caching mechanism here! | 345 // TODO Introduce a caching mechanism here! |
400 | 401 |
401 if (locations == null) { | 402 if (locations == null) { |
402 throw new NullPointerException("Cannot determine location."); | 403 throw new NullPointerException("Cannot determine location."); |
403 } | 404 } |
404 | 405 |
405 WstValueTable wst = WstValueTable.getTable(r); | 406 WstValueTable wst = WstValueTableFactory.getTable(r); |
406 if (wst == null) { | 407 if (wst == null) { |
407 throw new NullPointerException("No Wst found for selected river."); | 408 throw new NullPointerException("No Wst found for selected river."); |
408 } | 409 } |
409 | 410 |
410 // TODO Introduce a caching mechanism here! | 411 // TODO Introduce a caching mechanism here! |
460 River river = getRiver(); | 461 River river = getRiver(); |
461 if (river == null) { | 462 if (river == null) { |
462 logger.error("No river selected."); | 463 logger.error("No river selected."); |
463 } | 464 } |
464 | 465 |
465 WstValueTable wst = WstValueTable.getTable(river); | 466 WstValueTable wst = WstValueTableFactory.getTable(river); |
466 if (wst == null) { | 467 if (wst == null) { |
467 logger.error("No Wst found for selected river."); | 468 logger.error("No Wst found for selected river."); |
468 } | 469 } |
469 | 470 |
470 double[][] dist = getSplittedDistance(); | 471 double[][] dist = getSplittedDistance(); |