Changeset 10657 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-07-27T02:08:34+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/FilteredCollection.java
r7395 r10657 17 17 * @param predicate The predicate to use as filter 18 18 */ 19 public FilteredCollection(Collection<? extends T> collection, Predicate<? super T> predicate) {19 public FilteredCollection(Collection<? extends T> collection, java.util.function.Predicate<? super T> predicate) { 20 20 super(collection, predicate); 21 21 } -
trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java
r10584 r10657 120 120 * @return The filtered collection. It is a {@code Collection<T>}. 121 121 */ 122 public static <T> SubclassFilteredCollection<T, T> filter(Collection< T> collection, java.util.function.Predicate<T> predicate) {122 public static <T> SubclassFilteredCollection<T, T> filter(Collection<? extends T> collection, java.util.function.Predicate<T> predicate) { 123 123 return new SubclassFilteredCollection<>(collection, predicate); 124 124 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r10638 r10657 102 102 * Tests whether {@code predicate} applies to at least one element from {@code collection}. 103 103 * <p> 104 * Note: you can use {@link Stream#anyMatch(java.util.function.Predicate)} instead.105 104 * @param <T> type of items 106 105 * @param collection the collection 107 106 * @param predicate the predicate 108 107 * @return {@code true} if {@code predicate} applies to at least one element from {@code collection} 109 */ 108 * @deprecated use {@link Stream#anyMatch(java.util.function.Predicate)} instead. 109 */ 110 @Deprecated 110 111 public static <T> boolean exists(Iterable<? extends T> collection, Predicate<? super T> predicate) { 111 112 for (T item : collection) { … … 120 121 * Tests whether {@code predicate} applies to all elements from {@code collection}. 121 122 * <p> 122 * Note: you can use {@link Stream#allMatch(java.util.function.Predicate)} instead.123 123 * @param <T> type of items 124 124 * @param collection the collection 125 125 * @param predicate the predicate 126 126 * @return {@code true} if {@code predicate} applies to all elements from {@code collection} 127 */ 127 * @deprecated use {@link Stream#allMatch(java.util.function.Predicate)} instead. 128 */ 129 @Deprecated 128 130 public static <T> boolean forAll(Iterable<? extends T> collection, Predicate<? super T> predicate) { 129 131 return !exists(collection, Predicates.not(predicate));
Note:
See TracChangeset
for help on using the changeset viewer.