Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | fdb26fe898dc |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
23 | 23 |
24 | 24 |
25 /** Sediment Densities for multiple years. */ | 25 /** Sediment Densities for multiple years. */ |
26 public class SedimentDensity implements Serializable | 26 public class SedimentDensity implements Serializable |
27 { | 27 { |
28 private static final Logger logger = Logger | 28 private static final Logger log = Logger |
29 .getLogger(SedimentDensity.class); | 29 .getLogger(SedimentDensity.class); |
30 | 30 |
31 public static final double DEFAULT_SEDIMNET_DENSITY_FACTOR = 1.9; | 31 public static final double DEFAULT_SEDIMNET_DENSITY_FACTOR = 1.9; |
32 | 32 |
33 public static String SEDIMENT_DENSITY_FACTOR_XPATH = | 33 public static String SEDIMENT_DENSITY_FACTOR_XPATH = |
50 if (factorString != null) { | 50 if (factorString != null) { |
51 try { | 51 try { |
52 factor = Double.parseDouble(factorString.trim()); | 52 factor = Double.parseDouble(factorString.trim()); |
53 } | 53 } |
54 catch (NumberFormatException nfe) { | 54 catch (NumberFormatException nfe) { |
55 logger.error(nfe); | 55 log.error(nfe); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 logger.info("Sedmiment density factor: " + factor); | 59 log.info("Sedmiment density factor: " + factor); |
60 | 60 |
61 return factor; | 61 return factor; |
62 } | 62 } |
63 | 63 |
64 public SedimentDensity() { | 64 public SedimentDensity() { |
80 } | 80 } |
81 }; | 81 }; |
82 | 82 |
83 public void addDensity(double km, double density, int year) { | 83 public void addDensity(double km, double density, int year) { |
84 | 84 |
85 if (logger.isDebugEnabled()) { | 85 if (log.isDebugEnabled()) { |
86 logger.debug("adding " + year); | 86 log.debug("adding " + year); |
87 } | 87 } |
88 | 88 |
89 Integer key = Integer.valueOf(year); | 89 Integer key = Integer.valueOf(year); |
90 | 90 |
91 List<SedimentDensityValue> list = densities.get(key); | 91 List<SedimentDensityValue> list = densities.get(key); |
212 SedimentDensityValue prev, | 212 SedimentDensityValue prev, |
213 SedimentDensityValue next, | 213 SedimentDensityValue next, |
214 double km | 214 double km |
215 ) { | 215 ) { |
216 if (prev == null && next == null) { | 216 if (prev == null && next == null) { |
217 logger.warn("prev and next are null -> NaN"); | 217 log.warn("prev and next are null -> NaN"); |
218 return Double.NaN; | 218 return Double.NaN; |
219 } | 219 } |
220 | 220 |
221 if (prev == null) return next.getDensity(); | 221 if (prev == null) return next.getDensity(); |
222 if (next == null) return prev.getDensity(); | 222 if (next == null) return prev.getDensity(); |