Package noaa.coastwatch.render.feature
Class SelectionRuleFilter
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<SelectionRule>
,Collection<SelectionRule>
,List<SelectionRule>
,RandomAccess
A
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).- Since:
- 3.3.2
- Author:
- Peter Hollemans
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The mode that the filtering is operating under. -
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty filter with mode set toMATCHES_ANY
. -
Method Summary
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
SelectionRuleFilter
public SelectionRuleFilter()Creates a new empty filter with mode set toMATCHES_ANY
.
-
-
Method Details
-
clone
- Overrides:
clone
in classArrayList<SelectionRule>
-
filter
Filters a collection of features using the rules in this filter for matching.- Parameters:
features
- the features to filter.- Returns:
- the list of the matching features, possibly empty.
-
setMode
Sets the filtering mode.- Parameters:
mode
- the filtering mode, eitherMATCHES_ANY
orMATCHES_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.
-
getMode
Gets the current filtering mode.- Returns:
- the filtering mode, either
MATCHES_ANY
orMATCHES_ALL
. - See Also:
-
toString
- Overrides:
toString
in classAbstractCollection<SelectionRule>
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-