public static <T, X, E extends Throwable> Set<X> collect (Set<T> coll, APartialFunction<? super T, ? extends X, E> pf) throws E {
        final Set<X> result = createEmptySetOfType(coll, true);

        for(T o: coll) {
            if (pf.isDefinedAt (o)) {
                result.add (pf.apply (o));
            }
        }

        return result;
    }
public static <T, X, E extends Throwable> Set<X> collect (Set<T> coll, APartialFunction<? super T, ? extends X, E> pf) throws E {
        final Set<X> result = createEmptySetOfType(coll, true);

        for(T o: coll) {
            if (pf.isDefinedAt (o)) {
                result.add (pf.apply (o));
            }
        }

        return result;
    }
public static < T , X , E extends Throwable > Set < X > collect ( Set < T > coll , APartialFunction < ? super T , ? extends X , E > pf ) throws E { final Set < X > result = createEmptySetOfType ( coll , true ) ; for ( T o : coll ) { if ( pf . isDefinedAt ( o ) ) { result . add ( pf . apply ( o ) ) ; } } return result ; }
Applies a transformation function to all elements of a collection, where the partial function is defined for. Creates a new collection
of the transformed elements only. So the number of result elements may be less than the number of elements in the source collection.
Applies a transformation function to all elements of a collection where the partial function is defined for . Creates a new collection of the transformed elements only . So the number of result elements may be less than the number of elements in the source collection .