public class SelectionRuleFilter extends java.util.ArrayList<SelectionRule>
SelectionRuleFilter
is a list of SelectionRule
objects
together with an overall rule that determines how to filter a set of
Feature
objects. The filter list can be used for feature matching
in one of two ways: either all the rules must be matched for a certain
feature to be included, or any of the rules can be matched (at least one).Modifier and Type | Class and Description |
---|---|
static class |
SelectionRuleFilter.FilterMode
The mode that the filtering is operating under.
|
Constructor and Description |
---|
SelectionRuleFilter()
Creates a new empty filter with mode set to
MATCHES_ANY . |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
java.util.List<Feature> |
filter(java.util.List<Feature> features)
Filters a collection of features using the rules in this filter for
matching.
|
SelectionRuleFilter.FilterMode |
getMode()
Gets the current filtering mode.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
void |
setMode(SelectionRuleFilter.FilterMode mode)
Sets the filtering mode.
|
java.lang.String |
toString() |
add, add, addAll, addAll, clear, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public SelectionRuleFilter()
MATCHES_ANY
.public java.lang.Object clone()
clone
in class java.util.ArrayList<SelectionRule>
public java.util.List<Feature> filter(java.util.List<Feature> features)
features
- the features to filter.public void setMode(SelectionRuleFilter.FilterMode mode)
mode
- the filtering mode, either MATCHES_ANY
or MATCHES_ALL
. When set to 'any', if any single rule
matches a feature, the feature is included in the filter results. When
set to 'all', the entire list of rules must match the feature for it to
be included.public SelectionRuleFilter.FilterMode getMode()
MATCHES_ANY
or
MATCHES_ALL
.setMode(noaa.coastwatch.render.feature.SelectionRuleFilter.FilterMode)
public java.lang.String toString()
toString
in class java.util.AbstractCollection<SelectionRule>
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception