Ignore:
Timestamp:
2016-07-31T17:58:31+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390, fix #12890 - finish transition to Java 8 predicates/functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java

    r10657 r10691  
    66import java.util.Iterator;
    77import java.util.NoSuchElementException;
     8import java.util.function.Predicate;
    89
    910/**
     
    2223
    2324    private final Collection<? extends S> collection;
    24     private final java.util.function.Predicate<? super S> predicate;
     25    private final Predicate<? super S> predicate;
    2526    private int size = -1;
    2627
     
    7273     * @param collection The base collection to filter
    7374     * @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.
    7576     */
    76     @Deprecated
    7777    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 filter
    84      * @param predicate The predicate to use as filter
    85      * @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) {
    8878        this.collection = collection;
    8979        this.predicate = predicate;
     
    120110     * @return The filtered collection. It is a {@code Collection<T>}.
    121111     */
    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) {
    123113        return new SubclassFilteredCollection<>(collection, predicate);
    124114    }
Note: See TracChangeset for help on using the changeset viewer.