public class FilterUtil extends Object
| Constructor and Description |
|---|
FilterUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <Element> Collection<Element> |
filter(Collection<Element> elements,
Filter<Element>... filters)
Convenient method to filter the elements, trying to be as strict as
possible.
|
static <Element> Collection<Element> |
filter(Collection<Element> elements,
FilterDecider<Element> decider,
Filter<Element>... filters)
This method filter a collection of elements by using
Filters. |
static <Element> Collection<Element> |
filter(Collection<Element> elements,
FilteringStrategy uninformativeStrategy,
FilteringStrategy conflictualStrategy,
Filter<Element>... filters)
This method filter a collection of elements by using some
Filter
s. |
static <Element> Collection<Element> |
filterConservatively(Collection<Element> elements,
Filter<Element>... filters)
Convenient method to filter the elements, trying to keep as much as
possible.
|
static <Element> Collection<Element> |
filterExpeditively(Collection<Element> elements,
Filter<Element>... filters)
Convenient method to filter the elements, trying to reject as much as
possible.
|
public static <Element> Collection<Element> filter(Collection<Element> elements, Filter<Element>... filters) throws UndecidedFilteringException
filter(Collection, FilteringStrategy, FilteringStrategy, Filter...)
with both filtering modes at FilteringStrategy.EXPLICIT.UndecidedFilteringExceptionpublic static <Element> Collection<Element> filterConservatively(Collection<Element> elements, Filter<Element>... filters) throws UndecidedFilteringException
filter(Collection, FilteringStrategy, FilteringStrategy, Filter...)
with both filtering modes at FilteringStrategy.CONSERVATIVE.UndecidedFilteringExceptionpublic static <Element> Collection<Element> filterExpeditively(Collection<Element> elements, Filter<Element>... filters) throws UndecidedFilteringException
filter(Collection, FilteringStrategy, FilteringStrategy, Filter...)
with both filtering modes at FilteringStrategy.EXPEDITIVE.UndecidedFilteringExceptionpublic static <Element> Collection<Element> filter(Collection<Element> elements, FilteringStrategy uninformativeStrategy, FilteringStrategy conflictualStrategy, Filter<Element>... filters) throws UndecidedFilteringException
Filter
s. In the case no clear decision can be taken, some simple
FilteringStrategys are applied. Basically, it build a
FilterDecider based on these FilteringStrategys and
return the result of
filter(Collection, FilterDecider, Filter...).elements - the elements to filteruninformativeStrategy - FilteringStrategy to apply when no supporter nor
rejector is foundconflictualStrategy - FilteringStrategy to apply when both supporters and
rejectors are foundfilters - the filters to applyUndecidedFilteringException - when the FilteringStrategys does not allow to decidepublic static <Element> Collection<Element> filter(Collection<Element> elements, FilterDecider<Element> decider, Filter<Element>... filters) throws UndecidedFilteringException
Filters. In
the case the support/rejection cannot be decided (no Filter gives
an informative answer or both supporters and rejectors are found), a
FilterDecider take the lead and decide the final answer. This
allows for instance to manage custom strategies such as prioritized or
weighted Filters.elements - the elements to filterdecider - a FilterDecider which manages the undecided casesfilters - the filters to applyUndecidedFilteringException - when the FilterDecider is not able to decideCopyright © 2014–2015. All rights reserved.