comparison artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.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 7bf8ebdcc4ac
children e3a8aa6eee32
comparison
equal deleted inserted replaced
8201:4b8c5a08de04 8202:e4606eae8ea5
21 /** For the moment, light-weight wrapper around RiverUtils. */ 21 /** For the moment, light-weight wrapper around RiverUtils. */
22 // TODO employ 'Caching' like other Accesses, remove usage of RiverUtils. 22 // TODO employ 'Caching' like other Accesses, remove usage of RiverUtils.
23 public class RangeAccess 23 public class RangeAccess
24 extends RiverAccess 24 extends RiverAccess
25 { 25 {
26 private static Logger logger = Logger.getLogger(RangeAccess.class); 26 private static Logger log = Logger.getLogger(RangeAccess.class);
27 27
28 public static enum KM_MODE { RANGE, LOCATIONS, NONE }; 28 public static enum KM_MODE { RANGE, LOCATIONS, NONE };
29 29
30 double[] kmRange; 30 double[] kmRange;
31 31
102 for (String l: tmp) { 102 for (String l: tmp) {
103 try { 103 try {
104 locations.add(Double.parseDouble(l)); 104 locations.add(Double.parseDouble(l));
105 } 105 }
106 catch (NumberFormatException nfe) { 106 catch (NumberFormatException nfe) {
107 logger.debug(nfe.getLocalizedMessage(), nfe); 107 log.debug(nfe.getLocalizedMessage(), nfe);
108 } 108 }
109 } 109 }
110 110
111 locations.sort(); 111 locations.sort();
112 112
126 public double getFrom() { 126 public double getFrom() {
127 if (from == null) { 127 if (from == null) {
128 from = getDouble("ld_from"); 128 from = getDouble("ld_from");
129 } 129 }
130 130
131 if (logger.isDebugEnabled()) { 131 if (log.isDebugEnabled()) {
132 logger.debug("from from data: '" + from + "'"); 132 log.debug("from from data: '" + from + "'");
133 } 133 }
134 134
135 if (from == null) { 135 if (from == null) {
136 logger.warn("No 'from' found. assume max of river."); 136 log.warn("No 'from' found. assume max of river.");
137 return getRiver().determineMinMaxDistance()[0]; 137 return getRiver().determineMinMaxDistance()[0];
138 } 138 }
139 139
140 return from.doubleValue(); 140 return from.doubleValue();
141 } 141 }
145 public double getTo() { 145 public double getTo() {
146 if (to == null) { 146 if (to == null) {
147 to = getDouble("ld_to"); 147 to = getDouble("ld_to");
148 } 148 }
149 149
150 if (logger.isDebugEnabled()) { 150 if (log.isDebugEnabled()) {
151 logger.debug("to from data: '" + to + "'"); 151 log.debug("to from data: '" + to + "'");
152 } 152 }
153 153
154 if (to == null) { 154 if (to == null) {
155 logger.warn("No 'to' found. assume max of river."); 155 log.warn("No 'to' found. assume max of river.");
156 return getRiver().determineMinMaxDistance()[1]; 156 return getRiver().determineMinMaxDistance()[1];
157 } 157 }
158 158
159 return to.doubleValue(); 159 return to.doubleValue();
160 } 160 }
165 165
166 if (step == null) { 166 if (step == null) {
167 step = getDouble("ld_step"); 167 step = getDouble("ld_step");
168 } 168 }
169 169
170 if (logger.isDebugEnabled()) { 170 if (log.isDebugEnabled()) {
171 logger.debug("step: '" + step + "'"); 171 log.debug("step: '" + step + "'");
172 } 172 }
173 173
174 return step; 174 return step;
175 } 175 }
176 176
188 188
189 case LOCATIONS: { 189 case LOCATIONS: {
190 double[] locs = getLocations(); 190 double[] locs = getLocations();
191 // if no locations, nPE. 191 // if no locations, nPE.
192 if (locs == null) { 192 if (locs == null) {
193 logger.warn("no locations to get km range from."); 193 log.warn("no locations to get km range from.");
194 return new double[] { Double.NaN, Double.NaN }; 194 return new double[] { Double.NaN, Double.NaN };
195 } 195 }
196 return new double[] { locs[0], locs[locs.length-1] }; 196 return new double[] { locs[0], locs[locs.length-1] };
197 } 197 }
198 198

http://dive4elements.wald.intevation.org