Changeset 6772 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-01-29T21:14:07+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6749 r6772 65 65 public static final Charset UTF_8 = Charset.forName("UTF-8"); 66 66 67 /** 68 * Tests whether {@code predicate} applies to at least one elements from {@code collection}. 69 */ 67 70 public static <T> boolean exists(Iterable<? extends T> collection, Predicate<? super T> predicate) { 68 71 for (T item : collection) { … … 71 74 } 72 75 return false; 76 } 77 78 /** 79 * Tests whether {@code predicate} applies to all elements from {@code collection}. 80 */ 81 public static <T> boolean forAll(Iterable<? extends T> collection, Predicate<? super T> predicate) { 82 return !exists(collection, Predicates.not(predicate)); 73 83 } 74 84
Note: See TracChangeset
for help on using the changeset viewer.