src/java/fr/jayasoft/ivy/filter/FilterHelper.java
/**
     * we could have used commons-collections facility for this...
     * if we accepted to add dependencies on third party jars
     * @param col
     * @param filter
     * @return
     */
we could have used commons-collections facility for this
if we accepted to add dependencies on third party jars
@param col
@param filter
@return
we could have used commons - collections facility for this if we accepted to add dependencies on third party jars @param col @param filter @return
public static Collection filter(Collection col, Filter filter) {
        if (filter == null) {
            return col;
        }
        Collection ret = new ArrayList(col);
        for (Iterator iter = ret.iterator(); iter.hasNext();) {
            Object element = (Object)iter.next();
            if (!filter.accept(element)) {
                iter.remove();
            }
        }
        return ret;
    }
public static Collection filter ( Collection col , Filter filter ) { if ( filter == null ) { return col ; } Collection ret = new ArrayList ( col ) ; for ( Iterator iter = ret . iterator ( ) ; iter . hasNext ( ) ; ) { Object element = ( Object ) iter . next ( ) ; if ( ! filter . accept ( element ) ) { iter . remove ( ) ; } } return ret ; }
we could have used commons-collections facility for this...
 if we accepted to add dependencies on third party jars
 @param col
 @param filter
 @return
we could have used commons - collections facility for this ... if we accepted to add dependencies on third party jars @param col @param filter @return