(String attribute /*, int defaultValue*/)
| 304 | |
| 305 | |
| 306 | static public int getInteger(String attribute /*, int defaultValue*/) { |
| 307 | return Integer.parseInt(get(attribute)); |
| 308 | |
| 309 | /* |
| 310 | String value = get(attribute, null); |
| 311 | if (value == null) return defaultValue; |
| 312 | |
| 313 | try { |
| 314 | return Integer.parseInt(value); |
| 315 | } catch (NumberFormatException e) { |
| 316 | // ignored will just fall through to returning the default |
| 317 | System.err.println("expecting an integer: " + attribute + " = " + value); |
| 318 | } |
| 319 | return defaultValue; |
| 320 | //if (value == null) return defaultValue; |
| 321 | //return (value == null) ? defaultValue : |
| 322 | //Integer.parseInt(value); |
| 323 | */ |
| 324 | } |
| 325 | |
| 326 | |
| 327 | static public void setInteger(String key, int value) { |
no test coverage detected