|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.io.OrFilenameFilter
public final class OrFilenameFilter
An OrFilenameFilter logically ORs other
java.io.FilenameFilter objects. When its
accept() method is called, the OrFilenameFilter
object passes the file through the contained filters. The file is
accepted if it is accepted by any of the contained filters. This class
conceptually provides a logical "OR" operator for file filters.
The contained filters are applied in the order they were added to the
OrFilenameFilter object. This class's accept()
method stops looping over the contained filters as soon as it encounters
one whose accept() method returns true (implementing
a "short-circuited OR" operation.)
FilenameFilter,
AndFilenameFilter,
NotFilenameFilter,
OrFilenameFilter,
RegexFilenameFilter| Constructor Summary | |
|---|---|
OrFilenameFilter()
Construct a new OrFilenameFilter with no contained filters. |
|
OrFilenameFilter(java.io.FilenameFilter... filters)
Construct a new OrFilenameFilter with two contained filters. |
|
| Method Summary | |
|---|---|
boolean |
accept(java.io.File dir,
java.lang.String name)
Determine whether a file is to be accepted or not, based on the contained filters. |
OrFilenameFilter |
addFilter(java.io.FilenameFilter filter)
Add a filter to the set of contained filters. |
void |
removeFilter(java.io.FilenameFilter filter)
Remove a filter from the set of contained filters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OrFilenameFilter()
public OrFilenameFilter(java.io.FilenameFilter... filters)
addFilter() method.
filters - filters to add| Method Detail |
|---|
public OrFilenameFilter 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)
If the set of contained filters is empty, then this method returns true.
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 | |||||||||