|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.hunsicker.io.Filters
Filters is used to build a filter list to apply for a search.
Field Summary | |
static int |
POLICY_LAZY
If one filter accepts a file, the file will be accepted. |
static int |
POLICY_STRICT
Only if all filters accept a file, the file will be accepted. |
Constructor Summary | |
Filters()
Creates a new Filters object. |
|
Filters(int policy)
Creates a new Filters object. |
Method Summary | |
boolean |
accept(java.io.File dir,
java.lang.String name)
Tests if a specified file should be included in a file list. |
void |
addFilter(java.io.FilenameFilter filter)
Adds the given filter to the filter list. |
boolean |
contains(java.io.FilenameFilter filter)
Indicates wheter the given filter is contained in the filter list. |
int |
getPolicy()
Returns the policy currently being used. |
void |
removeFilter(java.io.FilenameFilter filter)
Removes the given filter. |
void |
setPolicy(int policy)
Sets the filter policy to use. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int POLICY_LAZY
public static final int POLICY_STRICT
Constructor Detail |
public Filters()
POLICY_STRICT
as its policy.
public Filters(int policy)
policy
- policy to use. Either POLICY_STRICT
or POLICY_LAZY
.Method Detail |
public void setPolicy(int policy)
policy
- policy to use. Either POLICY_STRICT
or POLICY_LAZY
.public int getPolicy()
setPolicy(int)
public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- the directory in which the file was found.name
- the name of the file.
true
if and only if the name should be included in the file
list.public void addFilter(java.io.FilenameFilter filter)
filter
- filter to add.public boolean contains(java.io.FilenameFilter filter)
filter
- filter.
true
if the filter was registered.public void removeFilter(java.io.FilenameFilter filter)
filter
- filter to remove.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |