Mercurial > dive4elements > river
changeset 5924:454b7b455cb6
PRFParser: Documentation.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 08 May 2013 14:58:16 +0200 |
parents | 131f5f58ff7d |
children | 59f6a47822a4 |
files | backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java Wed May 08 13:16:29 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java Wed May 08 14:58:16 2013 +0200 @@ -82,6 +82,12 @@ secondShift = Math.pow(10, secondFractionPlaces); } + /** + * @param kmData where data points will be added to. + * @param line Line to parse. + * @return -1 at invalid lines, 1 if maxRepetitions values have been + * read, 0 otherwise. + */ public int extractData(String line, List<XY> kmData) { int L = line.length(); if (L <= deleteChars) { @@ -92,7 +98,7 @@ boolean debug = log.isDebugEnabled(); - + // Repetitions are values per line ( ... 10.0 12.5 15.3 ... ) int rep = 0; for (;rep < maxRepetitions; ++rep) { if (pos >= L || pos + firstIntegerPlaces >= L) { @@ -103,7 +109,7 @@ String second = line.substring( pos + firstIntegerPlaces, - Math.min(L, pos+firstIntegerPlaces+secondIntegerPlaces)); + Math.min(L, pos + firstIntegerPlaces + secondIntegerPlaces)); double x, y; try { @@ -180,6 +186,7 @@ } } // class KMFormat + /** Mapping stations (km) to measured points. */ protected Map<Double, List<XY>> data; protected Integer year;