Deprecated
Most of the functionality of this class can now be achieved via lambda expressions using Component Filters
Created: Feb 1, 2006
Performs collection filtering based on a set of rules. A filter may dictate whether at least one rule or all rules are matched.
Note
Implementation of filter rules has changed in recent releases to fix behaviour. Please ensure you update your code to use explicit constructors.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | MATCH_ALL
Indicates that all rules must be matched to include an object in the filtered collection. |
| public static final int | MATCH_ANY
Indicates that any rule may be matched to include an object in the filtered collection. |
| private List | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final Collection | Returns: a filtered collectiona collection to filter c)Filter the given collection into a new collection. |
| public final T[] | Returns: a filtered arrayan array to filter objects)Returns a filtered subset of the specified array. |
| public final Predicate | |
| private List | |
| private List | |
| public final void |
| MATCH_ALL | back to summary |
|---|---|
| public static final int MATCH_ALL Indicates that all rules must be matched to include an object in the filtered collection. | |
| MATCH_ANY | back to summary |
|---|---|
| public static final int MATCH_ANY Indicates that any rule may be matched to include an object in the filtered collection. | |
| rules | back to summary |
|---|---|
| private List<Predicate<T>> rules | |
| type | back to summary |
|---|---|
| private final int type | |
| Filter | back to summary |
|---|---|
public Filter(Predicate<T>... rules)
| |
| Filter | back to summary |
|---|---|
| public Filter(Predicate<T>[] rules, final int type) Constructor.
| |
| filter | back to summary |
|---|---|
| public final Collection Filter the given collection into a new collection.
| |
| filter | back to summary |
|---|---|
| public final T[] filter(final T[] objects) Returns a filtered subset of the specified array.
| |
| getRules | back to summary |
|---|---|
public final Predicate
| |
| matchAll | back to summary |
|---|---|
| private List | |
| matchAny | back to summary |
|---|---|
| private List | |
| setRules | back to summary |
|---|---|
public final void setRules(final Predicate<T>[] rules)
| |