comparison backend/src/main/java/org/dive4elements/river/importer/uinfo/parsers/SalixParser.java @ 9408:66a43d9f65c8

Renamed salix column to iota
author mschaefer
date Thu, 16 Aug 2018 08:44:26 +0200
parents 63c086139391
children f0cad5212f49
comparison
equal deleted inserted replaced
9407:43c975f8ab92 9408:66a43d9f65c8
42 private static final String IMPORT_FILENAME = "Iota.csv"; 42 private static final String IMPORT_FILENAME = "Iota.csv";
43 43
44 private static final Pattern META_EVALUATOR = Pattern.compile("^#\\sAuswerter:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE); 44 private static final Pattern META_EVALUATOR = Pattern.compile("^#\\sAuswerter:\\s*([^;]*).*", Pattern.CASE_INSENSITIVE);
45 45
46 private enum ColTitlePattern { 46 private enum ColTitlePattern {
47 FACTOR("Salix.Fa.tor\\s*\\[(.*)\\].*"), // 47 FACTOR("Iota\\s*\\[(.*)\\].*"), //
48 MWMNW("\\(MW-MNW\\).*\\[(.*)\\].*"); 48 MWMNW("\\(MW-MNW\\).*\\[(.*)\\].*");
49 49
50 private final Pattern pattern; 50 private final Pattern pattern;
51 51
52 ColTitlePattern(final String regexp) { 52 ColTitlePattern(final String regexp) {
127 break; 127 break;
128 } 128 }
129 } 129 }
130 } 130 }
131 if ((this.cols.get(ColTitlePattern.FACTOR) < 0) || (this.cols.get(ColTitlePattern.MWMNW) < 0)) { 131 if ((this.cols.get(ColTitlePattern.FACTOR) < 0) || (this.cols.get(ColTitlePattern.MWMNW) < 0)) {
132 logError("Column of the salix factor and/or mnw-mw-diff could not be identified"); 132 logError("Column of the iota value and/or mnw-mw-diff could not be identified");
133 this.headerParsingState = ParsingState.STOP; 133 this.headerParsingState = ParsingState.STOP;
134 return false; 134 return false;
135 } 135 }
136 return true; 136 return true;
137 } 137 }
138 138
139 @Override 139 @Override
140 protected SalixKmLineImport createKmLineImport(final Double km, final String[] values) { 140 protected SalixKmLineImport createKmLineImport(final Double km, final String[] values) {
141 if (Double.isNaN(parseDoubleWithNull(values[this.cols.get(ColTitlePattern.FACTOR)]).doubleValue())) { 141 if (Double.isNaN(parseDoubleWithNull(values[this.cols.get(ColTitlePattern.FACTOR)]).doubleValue())) {
142 logError("Salix factor not found in line " + this.in.getLineNumber()); 142 logError("Iota not found in line " + this.in.getLineNumber());
143 return null; 143 return null;
144 } 144 }
145 if (Double.isNaN(parseDoubleWithNull(values[this.cols.get(ColTitlePattern.MWMNW)]).doubleValue())) { 145 if (Double.isNaN(parseDoubleWithNull(values[this.cols.get(ColTitlePattern.MWMNW)]).doubleValue())) {
146 logError("MNW-MW-diff not found in line " + this.in.getLineNumber()); 146 logError("MNW-MW-diff not found in line " + this.in.getLineNumber());
147 return null; 147 return null;

http://dive4elements.wald.intevation.org