Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WQKmsInterpolArtifact.java @ 3405:b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
flys-artifacts/trunk@5057 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 19 Jul 2012 09:37:52 +0000 |
parents | 4ac581062c40 |
children | afc7bfb4800b |
comparison
equal
deleted
inserted
replaced
3404:d7b065b88f10 | 3405:b0ba96bbf01d |
---|---|
79 //ex.: flood_protection-wstv-114-12 | 79 //ex.: flood_protection-wstv-114-12 |
80 if (code != null) { | 80 if (code != null) { |
81 String [] parts = code.split("-"); | 81 String [] parts = code.split("-"); |
82 | 82 |
83 if (parts.length >= 4) { | 83 if (parts.length >= 4) { |
84 int wst = Integer.valueOf(parts[3]); | 84 int wst = Integer.parseInt(parts[3]); |
85 int col = -1; | 85 int col = -1; |
86 String colpos = parts[2]; | 86 String colpos = parts[2]; |
87 // Are we interested in a single column or in all columns? | 87 // Are we interested in a single column or in all columns? |
88 if (colpos.equals("A")) { | 88 if (colpos.equals("A")) { |
89 ; // Take all. | 89 ; // Take all. |
90 } | 90 } |
91 else { | 91 else { |
92 col = Integer.valueOf(colpos); | 92 col = Integer.parseInt(colpos); |
93 addStringData("col_pos", parts[2]); | 93 addStringData("col_pos", parts[2]); |
94 } | 94 } |
95 addStringData("wst_id", parts[3]); | 95 addStringData("wst_id", parts[3]); |
96 String wkmsName = (col > 0) | 96 String wkmsName = (col > 0) |
97 ? WKmsFactory.getWKmsName(col, wst) | 97 ? WKmsFactory.getWKmsName(col, wst) |
205 * Get a DataItem casted to int (0 if fails). | 205 * Get a DataItem casted to int (0 if fails). |
206 */ | 206 */ |
207 public int getDataAsInt(String dataName) { | 207 public int getDataAsInt(String dataName) { |
208 String val = getDataAsString(dataName); | 208 String val = getDataAsString(dataName); |
209 try { | 209 try { |
210 return Integer.valueOf(val); | 210 return Integer.parseInt(val); |
211 } | 211 } |
212 catch (NumberFormatException e) { | 212 catch (NumberFormatException e) { |
213 logger.warn("Could not get data " + dataName + " as int", e); | 213 logger.warn("Could not get data " + dataName + " as int", e); |
214 return 0; | 214 return 0; |
215 } | 215 } |
258 public WQKms getWQKms(int idx) { | 258 public WQKms getWQKms(int idx) { |
259 logger.debug("WQKmsInterpolArtifact.getWQKms"); | 259 logger.debug("WQKmsInterpolArtifact.getWQKms"); |
260 logger.warn("Stub, getWQKms not yet implemented."); | 260 logger.warn("Stub, getWQKms not yet implemented."); |
261 | 261 |
262 return WQKmsFactory.getWQKms( | 262 return WQKmsFactory.getWQKms( |
263 Integer.valueOf(getDataAsString("col_pos")), | 263 Integer.parseInt(getDataAsString("col_pos")), |
264 Integer.valueOf(getDataAsString("wst_id"))); | 264 Integer.parseInt(getDataAsString("wst_id"))); |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 /** | 268 /** |
269 * Determines Facets initial disposition regarding activity (think of | 269 * Determines Facets initial disposition regarding activity (think of |