# HG changeset patch # User Felix Wolfsteller # Date 1368017896 -7200 # Node ID 454b7b455cb6d80e1b352ed0de7be3040693b52c # Parent 131f5f58ff7d3491f1aa9e8312a0ed981568c18a PRFParser: Documentation. diff -r 131f5f58ff7d -r 454b7b455cb6 backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java --- 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 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> data; protected Integer year;