org.clapper.util.io
Class CombinationFilenameFilter
- java.lang.Object
-
- org.clapper.util.io.CombinationFilenameFilter
-
- All Implemented Interfaces:
- java.io.FilenameFilter
Deprecated.UseAndFilenameFilterandOrFilenameFilter
public class CombinationFilenameFilter extends java.lang.Object implements java.io.FilenameFilterA 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 toAND_FILTERS, then a file must be accepted by all contained filters to be accepted. If the CombinationFilenameFilter object's mode is set toOR_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.
- See Also:
FilenameFilter,CombinationFileFilter,MultipleRegexFilenameFilter
-
-
Field Summary
Fields Modifier and Type Field and Description static CombinationFilterModeAND_FILTERSDeprecated.Convenience constant for backward compatibility: Mode setting that instructs the filter to AND all the contained filters.static CombinationFilterModeOR_FILTERSDeprecated.Convenience constant for backward compatibility: Mode setting that instructs the filter to OR all the contained filters.
-
Constructor Summary
Constructors Constructor and Description CombinationFilenameFilter()Deprecated.Construct a new CombinationFilenameFilter with a mode ofAND_FILTERS.CombinationFilenameFilter(CombinationFilterMode mode)Deprecated.Construct a new CombinationFilenameFilter with the specified mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description booleanaccept(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.voidaddFilter(java.io.FilenameFilter filter)Deprecated.Add a filter to the set of contained filters.CombinationFilterModegetMode()Deprecated.Get the combination mode of this CombinationFilenameFilter object.voidremoveFilter(java.io.FilenameFilter filter)Deprecated.Remove a filter from the set of contained filters.voidsetMode(CombinationFilterMode mode)Deprecated.Change the combination mode of this CombinationFilenameFilter object.
-
-
-
Field Detail
-
AND_FILTERS
public static final CombinationFilterMode AND_FILTERS
Deprecated.Convenience constant for backward compatibility: Mode setting that instructs the filter to AND all the contained filters.- See Also:
CombinationFilterMode.AND_FILTERS
-
OR_FILTERS
public static final CombinationFilterMode OR_FILTERS
Deprecated.Convenience constant for backward compatibility: Mode setting that instructs the filter to OR all the contained filters.- See Also:
CombinationFilterMode.OR_FILTERS
-
-
Constructor Detail
-
CombinationFilenameFilter
public CombinationFilenameFilter()
Deprecated.Construct a new CombinationFilenameFilter with a mode ofAND_FILTERS. The mode can be changed later by callingsetMode().
-
CombinationFilenameFilter
public CombinationFilenameFilter(CombinationFilterMode mode)
Deprecated.Construct a new CombinationFilenameFilter with the specified mode.- Parameters:
mode-AND_FILTERSif a filename must be accepted by all contained filters.OR_FILTERSif a filename only needs to be accepted by one of the contained filters.- See Also:
setMode(org.clapper.util.io.CombinationFilterMode)
-
-
Method Detail
-
getMode
public CombinationFilterMode getMode()
Deprecated.Get the combination mode of this CombinationFilenameFilter object.- Returns:
AND_FILTERSif a filename must be accepted by all contained filters.OR_FILTERSif a filename only needs to be accepted by one of the contained filters.- See Also:
setMode(org.clapper.util.io.CombinationFilterMode)
-
setMode
public void setMode(CombinationFilterMode mode)
Deprecated.Change the combination mode of this CombinationFilenameFilter object.- Parameters:
mode-AND_FILTERSif a filename must be accepted by all contained filters.OR_FILTERSif a filename only needs to be accepted by one of the contained filters.- See Also:
getMode()
-
addFilter
public void addFilter(java.io.FilenameFilter filter)
Deprecated.Add a filter to the set of contained filters.- Parameters:
filter- the FilenameFilter to add.- See Also:
removeFilter(java.io.FilenameFilter)
-
removeFilter
public void removeFilter(java.io.FilenameFilter filter)
Deprecated.Remove a filter from the set of contained filters.- Parameters:
filter- the FilenameFilter to remove.- See Also:
addFilter(java.io.FilenameFilter)
-
accept
public 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. If this object's mode mode is set toAND_FILTERS, then a file must be accepted by all contained filters to be accepted. If this object's mode is set toOR_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.- Specified by:
acceptin interfacejava.io.FilenameFilter- Parameters:
dir- The directory containing the file.name- the file name- Returns:
- true if the file matches, false if it doesn't
-
-
DMelt 3.0 © DataMelt by jWork.ORG