Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/WstParser.java @ 5542:f3b270e5462e
Wst Parser: Another attempt to fix the order of the Q ranges.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 03 Apr 2013 20:16:01 +0200 |
parents | b09c095a0b7e |
children | 732a8bd44650 |
comparison
equal
deleted
inserted
replaced
5541:b09c095a0b7e | 5542:f3b270e5462e |
---|---|
314 } | 314 } |
315 } | 315 } |
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 } | 319 } // for all lines in WST file |
320 | 320 |
321 wst.setUnit(new ImportUnit(einheit)); | 321 wst.setUnit(new ImportUnit(einheit)); |
322 | 322 |
323 addInterval(minKm, maxKm, aktAbfluesse); | 323 addInterval(minKm, maxKm, aktAbfluesse); |
324 | |
325 fixRangesOrder(); | |
324 } | 326 } |
325 finally { | 327 finally { |
326 if (in != null) { | 328 if (in != null) { |
327 in.close(); | 329 in.close(); |
328 } | 330 } |
329 } | 331 } |
332 } | |
333 | |
334 protected void fixRangesOrder() { | |
335 wst.fixRangesOrder(); | |
330 } | 336 } |
331 | 337 |
332 protected void addValue(BigDecimal km, BigDecimal w, int index) { | 338 protected void addValue(BigDecimal km, BigDecimal w, int index) { |
333 if (w != null) { | 339 if (w != null) { |
334 ImportWstColumn column = wst.getColumn(index); | 340 ImportWstColumn column = wst.getColumn(index); |
356 ) { | 362 ) { |
357 log.debug("addInterval: " + from + " " + to); | 363 log.debug("addInterval: " + from + " " + to); |
358 | 364 |
359 if (values == null || from == MAX_RANGE) { | 365 if (values == null || from == MAX_RANGE) { |
360 return; | 366 return; |
361 } | |
362 | |
363 if (to.compareTo(from) < 0) { | |
364 BigDecimal t = from; from = to; to = t; | |
365 } | 367 } |
366 | 368 |
367 ImportRange range = new ImportRange(from, to); | 369 ImportRange range = new ImportRange(from, to); |
368 | 370 |
369 // little workaround to make the q ranges tightly fit. | 371 // little workaround to make the q ranges tightly fit. |