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 enumThe 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, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods 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:
clonein 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_ANYorMATCHES_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_ANYorMATCHES_ALL. - See Also:
-
toString
- Overrides:
toStringin classAbstractCollection<SelectionRule>
-
main
Tests this class.- Parameters:
argv- the array of command line parameters.- Throws:
Exception
-