comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/SedimentDensityParser.java @ 5565:a44a3f997ec8

Cleanup whitespace. Removed unused variable.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Apr 2013 09:03:34 +0200
parents a2da78fdbec0
children
comparison
equal deleted inserted replaced
5564:a2da78fdbec0 5565:a44a3f997ec8
23 public class SedimentDensityParser extends LineParser { 23 public class SedimentDensityParser extends LineParser {
24 24
25 private static final Logger log = 25 private static final Logger log =
26 Logger.getLogger(SedimentDensityParser.class); 26 Logger.getLogger(SedimentDensityParser.class);
27 27
28 private int densitsyColumn = 1; 28 public static final NumberFormat nf =
29 29 NumberFormat.getInstance(DEFAULT_LOCALE);
30 public static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE);
31
32 30
33 public static final Pattern META_DEPTH = 31 public static final Pattern META_DEPTH =
34 Pattern.compile("^Tiefe: (\\w++)-(\\w++)( (\\w++))?.*"); 32 Pattern.compile("^Tiefe: (\\w++)-(\\w++)( (\\w++))?.*");
35 33
36 protected List<ImportSedimentDensity> sedimentDensities; 34 protected List<ImportSedimentDensity> sedimentDensities;
131 BigDecimal shoreOffset = null; 129 BigDecimal shoreOffset = null;
132 BigDecimal density = null; 130 BigDecimal density = null;
133 try { 131 try {
134 km = new BigDecimal(nf.parse(vals[0]).doubleValue()); 132 km = new BigDecimal(nf.parse(vals[0]).doubleValue());
135 density = new BigDecimal(nf.parse(vals[2]).doubleValue()); 133 density = new BigDecimal(nf.parse(vals[2]).doubleValue());
136 if (!vals[1].isEmpty()) { 134 if (!vals[1].isEmpty()) {
137 shoreOffset = new BigDecimal(nf.parse(vals[1]).doubleValue()); 135 shoreOffset = new BigDecimal(nf.parse(vals[1]).doubleValue());
138 } 136 }
139 } 137 }
140 catch (ParseException pe) { 138 catch (ParseException pe) {
141 log.warn("Unparseable numbers in '" + line + "'"); 139 log.warn("Unparseable numbers in '" + line + "'");
142 } 140 }
143 141
144 if (km == null || density == null) { 142 if (km == null || density == null) {
145 log.warn("SDP: No km nor density given. Skip line"); 143 log.warn("SDP: No km nor density given. Skip line");
146 return; 144 return;
147 } 145 }
148 146
149 BigDecimal year = null; 147 BigDecimal year = null;
150 148
151 current.addValue(new ImportSedimentDensityValue( 149 current.addValue(new ImportSedimentDensityValue(
152 km, 150 km,
153 shoreOffset, 151 shoreOffset,
154 density, 152 density,
155 year, 153 year,
156 currentDescription) 154 currentDescription));
157 );
158 } 155 }
159 156
160 157
161 public List<ImportSedimentDensity> getSedimentDensities() { 158 public List<ImportSedimentDensity> getSedimentDensities() {
162 return sedimentDensities; 159 return sedimentDensities;

http://dive4elements.wald.intevation.org