annotate backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentLoadLSParser.java @ 8031:6954ac9b7591

Renamed ImportSedimentYield to ImportSedimentLoadLS.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 11 Jul 2014 13:10:05 +0200
parents c915e99d9e52
children fd3a24336e6a
rev   line source
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
3 *
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
7 */
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
8
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
9 package org.dive4elements.river.importer.parsers;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
10
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
11 import java.io.File;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
12 import java.io.IOException;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
13
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
14 import java.text.NumberFormat;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
15 import java.text.ParseException;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
16
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
17 import java.util.ArrayList;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
18 import java.util.List;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
19 import java.util.regex.Matcher;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
20 import java.util.regex.Pattern;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
21
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
22 import org.apache.log4j.Logger;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
23
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
24 import org.dive4elements.river.importer.ImportGrainFraction;
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
25 import org.dive4elements.river.importer.ImportSedimentLoadLS;
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
26 import org.dive4elements.river.importer.ImportSedimentLoadLSValue;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
27 import org.dive4elements.river.importer.ImportTimeInterval;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
28 import org.dive4elements.river.importer.ImportUnit;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
29 import org.dive4elements.river.model.GrainFraction;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
30 import org.dive4elements.river.utils.DateUtil;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
31
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
32
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
33 /** Parses Sediment Yield files. */
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
34 public class SedimentLoadLSParser extends LineParser {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
35
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
36 private static final Logger log =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
37 Logger.getLogger(SedimentLoadLSParser.class);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
38
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
39
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
40 public static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
41
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
42
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
43 public static final String FRAKTION_START = "Fraktion:";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
44
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
45 public static final String FRACTION_COARSE_STR =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
46 ".*Grobkorn.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
47
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
48 public static final String FRACTION_FINE_MIDDLE_STR =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
49 ".*Fein.Mittel.Kies.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
50
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
51 public static final String FRACTION_SAND =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
52 ".*Sand.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
53
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
54 public static final String FRACTION_SUSP_SAND =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
55 ".*susp.Sand.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
56
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
57 public static final String FRACTION_SUSP_SAND_BED =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
58 ".*bettbild.Anteil.susp.Sand.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
59
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
60 public static final String FRACTION_SUSP_SAND_BED_EPOCH =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
61 ".*susp.Sand.bettbildAnteil.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
62
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
63 public static final String FRACTION_SUSPENDED_SEDIMENT =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
64 ".*Schwebstoff.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
65
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
66 public static final String FRACTION_TOTAL =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
67 ".*gesamt.*";
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
68
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
69
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
70 public static final Pattern TIMEINTERVAL_SINGLE =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
71 Pattern.compile("\\D*([0-9]+?)\\D*");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
72
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
73 public static final Pattern TIMEINTERVAL_EPOCH =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
74 Pattern.compile("\\D*([0-9]+?)\\s*-\\s*([0-9]+?)\\D*");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
75
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
76 public static final Pattern META_FRACTION =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
77 Pattern.compile("^Fraktion: (.*)");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
78
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
79 public static final Pattern META_UNIT =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
80 Pattern.compile("^Einheit: \\[(.*)\\].*");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
81
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
82 public static final Pattern META_COLUMN_NAMES =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
83 Pattern.compile("^Fluss-km.*");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
84
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
85 public static final Pattern META_GRAIN_FRACTION_A =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
86 Pattern.compile("\\D*(([0-9]+?,[0-9]+?)\\s*-|([0-9]++)\\s*-)(([0-9]+?,[0-9]+?)|([0-9]++))\\s*([a-zA-Z]+?)\\W*\\D*");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
87
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
88 public static final Pattern META_GRAIN_FRACTION_B =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
89 Pattern.compile("(<|>){1}\\s*(\\w++)\\s*(([0-9]+?,[0-9]+?)\\s*-|([0-9]++)\\s*-)(([0-9]+?,[0-9]+?)|([0-9]++))\\s*([a-zA-Z]+?)");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
90
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
91 public static final Pattern META_GRAIN_FRACTION_C =
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
92 Pattern.compile("(<|>){1}\\s*((([0-9]+?,[0-9]+?)|([0-9]++))\\s*(\\w+))");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
93
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
94
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
95 protected List<ImportSedimentLoadLS> sedimentYields;
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
96
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
97 protected ImportSedimentLoadLS[] current;
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
98
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
99 protected ImportGrainFraction grainFraction;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
100
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
101 protected ImportUnit unit;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
102
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
103 protected String description;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
104
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
105 protected String[] columnNames;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
106
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
107
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
108 public SedimentLoadLSParser() {
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
109 sedimentYields = new ArrayList<ImportSedimentLoadLS>();
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
110 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
111
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
112
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
113 @Override
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
114 public void parse(File file) throws IOException {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
115 description = file.getName();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
116
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
117 super.parse(file);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
118 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
119
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
120
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
121 @Override
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
122 protected void reset() {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
123 current = null;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
124 grainFraction = null;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
125 unit = null;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
126 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
127
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
128
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
129 @Override
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
130 protected void finish() {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
131 if (current != null) {
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
132 for (ImportSedimentLoadLS isy: current) {
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
133 sedimentYields.add(isy);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
134 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
135 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
136
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
137 description = null;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
138 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
139
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
140
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
141 @Override
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
142 protected void handleLine(int lineNum, String line) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
143 if (line.startsWith(START_META_CHAR)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
144 handleMetaLine(stripMetaLine(line));
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
145 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
146 else {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
147 handleDataLine(line);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
148 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
149 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
150
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
151
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
152 protected void handleMetaLine(String line) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
153 if (handleMetaUnit(line)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
154 return;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
155 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
156 else if (handleMetaFraction(line)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
157 return;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
158 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
159 else if (handleColumnNames(line)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
160 return;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
161 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
162 else {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
163 log.warn("SYP: Unknown meta line: '" + line + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
164 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
165 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
166
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
167
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
168 protected boolean handleMetaUnit(String line) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
169 Matcher m = META_UNIT.matcher(line);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
170
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
171 if (m.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
172 unit = new ImportUnit(m.group(1));
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
173 return true;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
174 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
175
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
176 return false;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
177 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
178
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
179
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
180 public boolean handleMetaFraction(String line) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
181 Matcher m = META_FRACTION.matcher(line);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
182
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
183 if (m.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
184 String tmp = m.group(1);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
185
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
186 this.grainFraction = buildGrainFraction(tmp);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
187
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
188 return true;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
189 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
190 else if (line.startsWith(FRAKTION_START)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
191 String newLine = line.replace(FRAKTION_START, "").trim();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
192 if (newLine.length() == 0) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
193 log.debug("Found total grain fraction.");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
194 this.grainFraction = new ImportGrainFraction(GrainFraction.UNKNOWN);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
195
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
196 return true;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
197 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
198 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
199
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
200 return false;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
201 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
202
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
203
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
204 public boolean handleColumnNames(String line) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
205 Matcher m = META_COLUMN_NAMES.matcher(line);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
206
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
207 if (m.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
208 columnNames = line.split(SEPERATOR_CHAR);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
209
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
210 initializeSedimentYields();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
211
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
212 return true;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
213 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
214
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
215 return false;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
216 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
217
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
218
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
219 protected void handleDataLine(String line) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
220 String[] vals = line.split(SEPERATOR_CHAR);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
221
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
222 if (vals == null || vals.length < columnNames.length-1) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
223 log.warn("SYP: skip invalid data line: '" + line + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
224 return;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
225 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
226
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
227 try {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
228 Double km = nf.parse(vals[0]).doubleValue();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
229
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
230 for (int i = 1, n = columnNames.length-1; i < n; i++) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
231 String curVal = vals[i];
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
232
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
233 if (curVal != null && curVal.length() > 0) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
234 current[i-1].addValue(new ImportSedimentLoadLSValue(
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
235 km, nf.parse(vals[i]).doubleValue()
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
236 ));
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
237 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
238 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
239 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
240 catch (ParseException pe) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
241 log.warn("SYP: unparseable number in data row '" + line + "':", pe);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
242 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
243 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
244
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
245
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
246 /** Initialize SedimentYields from columns, set the kind
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
247 * with respect to file location (offical epoch or not?) */
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
248 private void initializeSedimentYields() {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
249 // skip first column (Fluss-km) and last column (Hinweise)
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
250 current = new ImportSedimentLoadLS[columnNames.length-2];
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
251
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
252 Integer kind;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
253
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
254 if (inputFile.getAbsolutePath().contains("amtliche Epochen")) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
255 kind = new Integer(1);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
256 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
257 else {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
258 kind = new Integer(0);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
259 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
260
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
261 for (int i = 0, n = columnNames.length; i < n-2; i++) {
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
262 current[i] = new ImportSedimentLoadLS(this.description);
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
263 current[i].setTimeInterval(getTimeInterval(columnNames[i+1]));
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
264 current[i].setUnit(unit);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
265 current[i].setGrainFraction(grainFraction);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
266 current[i].setKind(kind);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
267 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
268 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
269
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
270
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
271 private ImportTimeInterval getTimeInterval(String column) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
272 try {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
273 Matcher a = TIMEINTERVAL_EPOCH.matcher(column);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
274 if (a.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
275 int yearA = nf.parse(a.group(1)).intValue();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
276 int yearB = nf.parse(a.group(2)).intValue();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
277
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
278 return new ImportTimeInterval(
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
279 DateUtil.getStartDateFromYear(yearA),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
280 DateUtil.getEndDateFromYear(yearB)
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
281 );
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
282 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
283
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
284 Matcher b = TIMEINTERVAL_SINGLE.matcher(column);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
285 if (b.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
286 int year = nf.parse(b.group(1)).intValue();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
287
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
288 return new ImportTimeInterval(DateUtil.getStartDateFromYear(year));
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
289 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
290
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
291 log.warn("SYP: Unknown time interval string: '" + column + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
292 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
293 catch (ParseException pe) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
294 log.warn("SYP: Could not parse years: " + column, pe);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
295 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
296
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
297 return null;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
298 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
299
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
300
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
301 private ImportGrainFraction buildGrainFraction(String gfStr) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
302 Matcher a = META_GRAIN_FRACTION_A.matcher(gfStr);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
303 if (a.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
304 String lowerA = a.group(2);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
305 String lowerB = a.group(3);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
306
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
307 String upperA = a.group(4);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
308 String upperB = a.group(5);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
309
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
310 String lower = lowerA != null ? lowerA : lowerB;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
311 String upper = upperA != null ? upperA : upperB;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
312
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
313 try {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
314 return new ImportGrainFraction(
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
315 getGrainFractionTypeName(this.description),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
316 nf.parse(lower).doubleValue(),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
317 nf.parse(upper).doubleValue()
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
318 );
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
319 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
320 catch (ParseException pe) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
321 log.warn("SYP: Could not parse ranges of: '" + gfStr + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
322 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
323 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
324
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
325 Matcher b = META_GRAIN_FRACTION_B.matcher(gfStr);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
326 if (b.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
327 String lowerA = b.group(4);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
328 String lowerB = b.group(5);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
329 String upperA = b.group(6);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
330 String upperB = b.group(7);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
331
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
332 String lower = lowerA != null ? lowerA : lowerB;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
333 String upper = upperA != null ? upperA : upperB;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
334
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
335 try {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
336 return new ImportGrainFraction(
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
337 getGrainFractionTypeName(this.description),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
338 nf.parse(lower).doubleValue(),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
339 nf.parse(upper).doubleValue()
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
340 );
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
341 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
342 catch (ParseException pe) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
343 log.warn("SYP: Could not parse ranges of: '" + gfStr + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
344 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
345 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
346
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
347 Matcher c = META_GRAIN_FRACTION_C.matcher(gfStr);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
348 if (c.matches()) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
349 String oper = c.group(1);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
350 String valueStr = c.group(3);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
351
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
352 try {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
353 Double value = nf.parse(valueStr).doubleValue();
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
354
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
355 if (oper.equals(">")) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
356 return new ImportGrainFraction(
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
357 getGrainFractionTypeName(this.description),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
358 value,
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
359 null
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
360 );
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
361 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
362 else {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
363 return new ImportGrainFraction(
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
364 getGrainFractionTypeName(this.description),
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
365 null,
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
366 value
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
367 );
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
368 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
369 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
370 catch (ParseException pe) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
371 log.warn("SYP: Could not parse ranges of: '" + gfStr + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
372 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
373 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
374
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
375 log.warn("SYP: Unknown grain fraction: '" + gfStr + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
376 return new ImportGrainFraction(GrainFraction.UNKNOWN);
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
377 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
378
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
379
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
380 public static String getGrainFractionTypeName(String filename) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
381 if (Pattern.matches(FRACTION_COARSE_STR, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
382 return GrainFraction.COARSE;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
383 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
384 else if (Pattern.matches(FRACTION_FINE_MIDDLE_STR, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
385 return GrainFraction.FINE_MIDDLE;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
386 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
387 else if (Pattern.matches(FRACTION_SUSP_SAND_BED, filename) ||
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
388 Pattern.matches(FRACTION_SUSP_SAND_BED_EPOCH, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
389 return GrainFraction.SUSP_SAND_BED;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
390 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
391 else if (Pattern.matches(FRACTION_SUSP_SAND, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
392 return GrainFraction.SUSP_SAND;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
393 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
394 else if (Pattern.matches(FRACTION_SAND, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
395 return GrainFraction.SAND;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
396 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
397 else if (Pattern.matches(FRACTION_SUSPENDED_SEDIMENT, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
398 return GrainFraction.SUSPENDED_SEDIMENT;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
399 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
400 else if (Pattern.matches(FRACTION_TOTAL, filename)) {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
401 return GrainFraction.TOTAL;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
402 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
403 else {
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
404 log.warn("SYP: Unknown grain fraction '" + filename + "'");
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
405 return GrainFraction.UNKNOWN;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
406 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
407 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
408
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
409
8031
6954ac9b7591 Renamed ImportSedimentYield to ImportSedimentLoadLS.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 8025
diff changeset
410 public List<ImportSedimentLoadLS> getSedimentYields() {
8025
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
411 return sedimentYields;
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
412 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
413 }
c915e99d9e52 Renamed SedimentYield to SedimentLoadLS and SedimentYieldValue to SedimentLoadLSValue. Adjust the names of the parsers and the rest of the glue.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
414 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org