Changeset 10691 in josm for trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java
- Timestamp:
- 2016-07-31T17:58:31+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java
r10657 r10691 6 6 import java.util.Iterator; 7 7 import java.util.NoSuchElementException; 8 import java.util.function.Predicate; 8 9 9 10 /** … … 22 23 23 24 private final Collection<? extends S> collection; 24 private final java.util.function.Predicate<? super S> predicate;25 private final Predicate<? super S> predicate; 25 26 private int size = -1; 26 27 … … 72 73 * @param collection The base collection to filter 73 74 * @param predicate The predicate to use as filter 74 * @ deprecated Use java predicates instead.75 * @see #filter(Collection, Predicate) for an alternative way to construct this. 75 76 */ 76 @Deprecated77 77 public SubclassFilteredCollection(Collection<? extends S> collection, Predicate<? super S> predicate) { 78 this(collection, (java.util.function.Predicate<? super S>) predicate);79 }80 81 /**82 * Constructs a new {@code SubclassFilteredCollection}.83 * @param collection The base collection to filter84 * @param predicate The predicate to use as filter85 * @see #filter(Collection, java.util.function.Predicate) for an alternative way to construct this.86 */87 public SubclassFilteredCollection(Collection<? extends S> collection, java.util.function.Predicate<? super S> predicate) {88 78 this.collection = collection; 89 79 this.predicate = predicate; … … 120 110 * @return The filtered collection. It is a {@code Collection<T>}. 121 111 */ 122 public static <T> SubclassFilteredCollection<T, T> filter(Collection<? extends T> collection, java.util.function.Predicate<T> predicate) {112 public static <T> SubclassFilteredCollection<T, T> filter(Collection<? extends T> collection, Predicate<T> predicate) { 123 113 return new SubclassFilteredCollection<>(collection, predicate); 124 114 }
Note:
See TracChangeset
for help on using the changeset viewer.