Changeset 10721 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-08-03T17:54:36+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r10718 r10721 223 223 224 224 /** 225 * Returns the minimum of three values.226 * @param a an argument.227 * @param b another argument.228 * @param c another argument.229 * @return the smaller of {@code a}, {@code b} and {@code c}.230 */231 public static int min(int a, int b, int c) {232 if (b < c) {233 if (a < b)234 return a;235 return b;236 } else {237 if (a < c)238 return a;239 return c;240 }241 }242 243 /**244 * Returns the greater of four {@code int} values. That is, the245 * result is the argument closer to the value of246 * {@link Integer#MAX_VALUE}. If the arguments have the same value,247 * the result is that same value.248 *249 * @param a an argument.250 * @param b another argument.251 * @param c another argument.252 * @param d another argument.253 * @return the larger of {@code a}, {@code b}, {@code c} and {@code d}.254 */255 public static int max(int a, int b, int c, int d) {256 return Math.max(Math.max(a, b), Math.max(c, d));257 }258 259 /**260 225 * Ensures a logical condition is met. Otherwise throws an assertion error. 261 226 * @param condition the condition to be met … … 565 530 */ 566 531 public static void close(ZipFile zip) { 567 if (zip == null) return; 568 try { 569 zip.close(); 570 } catch (IOException e) { 571 Main.warn(e); 572 } 532 close((Closeable) zip); 573 533 } 574 534
Note: See TracChangeset
for help on using the changeset viewer.