/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { return !subfilter.matches(object); }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { return !subfilter.matches(object); }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { return !subfilter.matches(object); }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { boolean matched = false; for(Filter<T> filter : getSubFilters()) { matched = matched || filter.matches(object); if(matched) { return true; } } return false; } }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { boolean matched = false; for(Filter<T> filter : getSubFilters()) { matched = matched || filter.matches(object); if(matched) { return true; } } return false; } }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { boolean matched = true; for(Filter<T> filter : getSubFilters()) { matched = matched && filter.matches(object); if(!matched) { return false; } } return true; } }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { boolean matched = true; for(Filter<T> filter : getSubFilters()) { matched = matched && filter.matches(object); if(!matched) { return false; } } return true; } }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { boolean matched = false; for(Filter<T> filter : getSubFilters()) { matched = matched || filter.matches(object); if(matched) { return true; } } return false; } }
/** * @see org.dihedron.core.filters.Filter#matches(java.lang.Object) */ @Override public boolean matches(T object) { boolean matched = true; for(Filter<T> filter : getSubFilters()) { matched = matched && filter.matches(object); if(!matched) { return false; } } return true; } }
/** * Applies the given filter to the input and returns only those elements * that match it. * * @param filter * a (possible compound) filter; elements in the input array matching the * filter will be returned. * @param elements * the collection of objects to filter. * @return * a filtered set of elements. */ public static <T> Collection<T> apply(Filter<T> filter, Collection<T> elements) { Collection<T> result = new ArrayList<T>(); if(elements != null) { for(T element : elements) { logger.trace("analysing element '{}'...", element); if(filter.matches(element)) { logger.trace("... element '{}' matches", element); result.add(element); } else { logger.trace("... element '{}' skipped", element); } } } return result; }
/** * Applies the given filter to the input and returns only those elements * that match it. * * @param filter * a (possible compound) filter; elements in the input array matching the * filter will be returned. * @param elements * the collection of objects to filter. * @return * a filtered set of elements. */ public static <T> Collection<T> apply(Filter<T> filter, Collection<T> elements) { Collection<T> result = new ArrayList<T>(); if(elements != null) { for(T element : elements) { logger.trace("analysing element '{}'...", element); if(filter.matches(element)) { logger.trace("... element '{}' matches", element); result.add(element); } else { logger.trace("... element '{}' skipped", element); } } } return result; }
/** * Applies the given filter to the input and returns only those elements * that match it. * * @param filter * a (possible compound) filter; elements in the input array matching the * filter will be returned. * @param elements * the collection of objects to filter. * @return * a filtered set of elements. */ public static <T> Collection<T> apply(Filter<T> filter, Collection<T> elements) { Collection<T> result = new ArrayList<T>(); if(elements != null) { for(T element : elements) { logger.trace("analysing element '{}'...", element); if(filter.matches(element)) { logger.trace("... element '{}' matches", element); result.add(element); } else { logger.trace("... element '{}' skipped", element); } } } return result; }