Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/WaterlevelExporter.java @ 2612:49cfa5c66651
Squashed performance bug introduced in rev4070. Now CSV export is about 245 times faster.
flys-artifacts/trunk@4195 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 04 Apr 2012 10:32:45 +0000 |
parents | 00cf69edfcc0 |
children | f8a1a8af338e |
comparison
equal
deleted
inserted
replaced
2611:62e5c6fd2a0c | 2612:49cfa5c66651 |
---|---|
464 ? Formatter.getWaterlevelW(context).format(value) : null; | 464 ? Formatter.getWaterlevelW(context).format(value) : null; |
465 } | 465 } |
466 | 466 |
467 long startTime = System.currentTimeMillis(); | 467 long startTime = System.currentTimeMillis(); |
468 | 468 |
469 String colDesc = !isRange | |
470 ? FLYSUtils.getNamedMainValue((WINFOArtifact)flys, wqkms.getRawValue()) | |
471 : desc; | |
472 | |
469 for (int i = 0; i < size; i ++) { | 473 for (int i = 0; i < size; i ++) { |
470 result = wqkms.get(i, result); | 474 result = wqkms.get(i, result); |
471 | 475 |
472 if (atGauge) { | 476 if (atGauge) { |
473 String tmp = desc; | |
474 if (!isRange) { | |
475 tmp = FLYSUtils.getNamedMainValue((WINFOArtifact)flys, wqkms.getRawValue()); | |
476 } | |
477 writer.writeNext(new String[] { | 477 writer.writeNext(new String[] { |
478 kmf.format(result[2]), | 478 kmf.format(result[2]), |
479 wf.format(result[0]), | 479 wf.format(result[0]), |
480 qf.format(result[1]), | 480 qf.format(result[1]), |
481 tmp, | 481 colDesc, |
482 FLYSUtils.getLocationDescription(flys, result[2]), | 482 FLYSUtils.getLocationDescription(flys, result[2]), |
483 result[2] >= a && result[2] <= b | 483 result[2] >= a && result[2] <= b |
484 ? gaugeName | 484 ? gaugeName |
485 : notinrange | 485 : notinrange |
486 }); | 486 }); |