comparison backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java @ 7342:c9b9176b0530 double-precision

WST-Parser: check consistence of station ordering in file.
author Tom Gottfried <tom@intevation.de>
date Tue, 15 Oct 2013 19:19:45 +0200
parents 588b02a4078a
children 82191d111130
comparison
equal deleted inserted replaced
7341:588b02a4078a 7342:c9b9176b0530
336 " (line " + in.getLineNumber() + 336 " (line " + in.getLineNumber() +
337 ") found more than once. -> ignored"); 337 ") found more than once. -> ignored");
338 continue; 338 continue;
339 } 339 }
340 340
341 // check consistence of station ordering in file
342 if (kmHist2 != null &&
343 kmHist2.compareTo(kmHist1) != kmHist1.compareTo(kaem)) {
344 throw new ParseException("Stations in " + file +
345 " near line " + in.getLineNumber() +
346 " not ordered. File rejected.");
347 }
348
349 // remember stations in two previous lines
341 kmHist2 = kmHist1; 350 kmHist2 = kmHist1;
342 kmHist1 = kaem; 351 kmHist1 = kaem;
343 352
344 // iteratively determine actual km-range 353 // iteratively determine actual km-range
345 if (kaem.compareTo(minKm) < 0) { 354 if (kaem.compareTo(minKm) < 0) {

http://dive4elements.wald.intevation.org