|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthredds.cataloggen.config.DatasetFilter
public class DatasetFilter
Provides filtering capabilities for InvDatasets.
The static method acceptDatasetByFilterGroup() is provided to allow filtering with a group of filters. To make filtering out a set of datasets as easy as allowing a set of datasets, DatasetFilter provides a dataset reject mode as well as a dataset accept mode. [Notes: 1) rejection of a dataset takes precedence over acceptance; and 2) all datasets are accepted if the filter group is empty.] A DatasetFilter instance contains information on how to filter datasets and can be set to either accept or reject datasets that match the filter criteria (accept is the default). The accept() method should only be called if the isAcceptMatchingDatasets() method returns true. Similarly, the reject() method should only be called if the isRejectMatchingDatasets() method returns true.
Field Summary | |
---|---|
protected Pattern |
regExpPattern
|
Constructor Summary | |
---|---|
DatasetFilter(DatasetSource parentDsSource,
String name,
thredds.cataloggen.config.DatasetFilter.Type type,
String matchPattern)
Constructor |
|
DatasetFilter(DatasetSource parentDsSource,
String name,
thredds.cataloggen.config.DatasetFilter.Type type,
String matchPattern,
boolean applyToCollectionDatasets,
boolean applyToAtomicDatasets,
boolean rejectMatchingDatasets)
|
Method Summary | |
---|---|
boolean |
accept(InvDataset dataset)
Test whether the given dataset should be included in a dataset collection. |
static boolean |
acceptDatasetByFilterGroup(List filters,
InvDataset dataset,
boolean isCollectionDataset)
Given a dataset and a group of filters, return true if the group of filters indicates that the dataset should be accepted, false if it should be rejected. |
protected boolean |
appliesToDataset(InvDataset dataset)
|
String |
getMatchPattern()
Return the matchPattern of this DatasetFilter |
String |
getMatchPatternTarget()
|
String |
getName()
Return the name of this DatasetFilter |
DatasetSource |
getParentDatasetSource()
Return the parent DatasetSource of this DatasetFilter |
thredds.cataloggen.config.DatasetFilter.Type |
getType()
Return the type of this DatasetFilter |
boolean |
isAcceptMatchingDatasets()
|
boolean |
isApplyToAtomicDatasets()
|
boolean |
isApplyToCollectionDatasets()
|
boolean |
isRejectMatchingDatasets()
|
boolean |
reject(InvDataset dataset)
Test whether the given dataset should be excluded from the dataset collection. |
void |
setApplyToAtomicDatasets(boolean applyToAtomicDatasets)
|
void |
setApplyToCollectionDatasets(boolean applyToCollectionDatasets)
|
void |
setMatchPatternTarget(String matchPatternTarget)
|
void |
setRejectMatchingDatasets(boolean rejectMatchingDatasets)
|
String |
toString()
string representation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Pattern regExpPattern
Constructor Detail |
---|
public DatasetFilter(DatasetSource parentDsSource, String name, thredds.cataloggen.config.DatasetFilter.Type type, String matchPattern)
parentDsSource
- name
- type
- matchPattern
- public DatasetFilter(DatasetSource parentDsSource, String name, thredds.cataloggen.config.DatasetFilter.Type type, String matchPattern, boolean applyToCollectionDatasets, boolean applyToAtomicDatasets, boolean rejectMatchingDatasets)
Method Detail |
---|
public DatasetSource getParentDatasetSource()
public String getName()
public thredds.cataloggen.config.DatasetFilter.Type getType()
public String getMatchPattern()
public String getMatchPatternTarget()
public void setMatchPatternTarget(String matchPatternTarget)
public boolean isApplyToCollectionDatasets()
public void setApplyToCollectionDatasets(boolean applyToCollectionDatasets)
public boolean isApplyToAtomicDatasets()
public void setApplyToAtomicDatasets(boolean applyToAtomicDatasets)
public boolean isRejectMatchingDatasets()
public boolean isAcceptMatchingDatasets()
public void setRejectMatchingDatasets(boolean rejectMatchingDatasets)
public String toString()
toString
in class Object
public boolean reject(InvDataset dataset)
dataset
- - the dataset to be tested
IllegalStateException
- if the filter accepts rather than rejects datasets.public boolean accept(InvDataset dataset)
dataset
- - the dataset to be tested
IllegalStateException
- if the filter rejects rather than accepts datasets.protected boolean appliesToDataset(InvDataset dataset)
public static boolean acceptDatasetByFilterGroup(List filters, InvDataset dataset, boolean isCollectionDataset)
filters
- - the group of filters to apply to the dataset.dataset
- - the dataset on which to apply the filter group.isCollectionDataset
-
NullPointerException
- if the filter list or the dataset is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |