|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.io.CombinationFilenameFilter
AndFilenameFilter and OrFilenameFilter
public class CombinationFilenameFilter
A CombinationFilenameFilter contains one or more
java.io.FilenameFilter objects. When its accept()
method is called, the CombinationFilenameFilter object passes
the file through the contained filters. If the
CombinationFilenameFilter object's mode is set to
AND_FILTERS, then a file must be accepted by all contained
filters to be accepted. If the CombinationFilenameFilter
object's mode is set to OR_FILTERS, then a file name is
accepted if any one of the contained filters accepts it. The default
mode is AND_FILTERS.
The contained filters are applied in the order they were added to the CombinationFilenameFilter object.
FilenameFilter,
CombinationFileFilter,
MultipleRegexFilenameFilter| Field Summary | |
|---|---|
static CombinationFilterMode |
AND_FILTERS
Deprecated. Convenience constant for backward compatibility: Mode setting that instructs the filter to AND all the contained filters. |
static CombinationFilterMode |
OR_FILTERS
Deprecated. Convenience constant for backward compatibility: Mode setting that instructs the filter to OR all the contained filters. |
| Constructor Summary | |
|---|---|
CombinationFilenameFilter()
Deprecated. Construct a new CombinationFilenameFilter with a mode of AND_FILTERS. |
|
CombinationFilenameFilter(CombinationFilterMode mode)
Deprecated. Construct a new CombinationFilenameFilter with the specified mode. |
|
| Method Summary | |
|---|---|
boolean |
accept(java.io.File dir,
java.lang.String name)
Deprecated. Determine whether a file is to be accepted or not, based on the contained filters and the mode. |
void |
addFilter(java.io.FilenameFilter filter)
Deprecated. Add a filter to the set of contained filters. |
CombinationFilterMode |
getMode()
Deprecated. Get the combination mode of this CombinationFilenameFilter object. |
void |
removeFilter(java.io.FilenameFilter filter)
Deprecated. Remove a filter from the set of contained filters. |
void |
setMode(CombinationFilterMode mode)
Deprecated. Change the combination mode of this CombinationFilenameFilter object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final CombinationFilterMode AND_FILTERS
CombinationFilterMode.AND_FILTERSpublic static final CombinationFilterMode OR_FILTERS
CombinationFilterMode.OR_FILTERS| Constructor Detail |
|---|
public CombinationFilenameFilter()
AND_FILTERS. The mode can be changed later by calling
setMode().
CombinationFilenameFilter(CombinationFilterMode),
setMode(org.clapper.util.io.CombinationFilterMode)public CombinationFilenameFilter(CombinationFilterMode mode)
mode - AND_FILTERS if a filename must be accepted
by all contained filters. OR_FILTERS if a
filename only needs to be accepted by one of the
contained filters.setMode(org.clapper.util.io.CombinationFilterMode)| Method Detail |
|---|
public CombinationFilterMode getMode()
AND_FILTERS if a filename must be accepted by all
contained filters. OR_FILTERS if a filename only
needs to be accepted by one of the contained filters.setMode(org.clapper.util.io.CombinationFilterMode)public void setMode(CombinationFilterMode mode)
mode - AND_FILTERS if a filename must be accepted
by all contained filters. OR_FILTERS if a
filename only needs to be accepted by one of the
contained filters.getMode()public void addFilter(java.io.FilenameFilter filter)
filter - the FilenameFilter to add.removeFilter(java.io.FilenameFilter)public void removeFilter(java.io.FilenameFilter filter)
filter - the FilenameFilter to remove.addFilter(java.io.FilenameFilter)
public boolean accept(java.io.File dir,
java.lang.String name)
AND_FILTERS, then a file must be accepted by all contained
filters to be accepted. If this object's mode is set to
OR_FILTERS, then a file name is accepted if any one of the
contained filters accepts it. If the set of contained filters is
empty, then this method returns false.
accept in interface java.io.FilenameFilterdir - The directory containing the file.name - the file name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||