public class NameFilenameFilter extends Object implements FilenameFilter
FilenameFilter that only returns files if
the have one of the specified file names. More than one file name can be
specified by using the addName(String) method.| Constructor and Description |
|---|
NameFilenameFilter()
Construct a new NameFilenameFilter with no file names.
|
NameFilenameFilter(Collection filenames)
Construct a new NameFilenameFilter with the file names.
|
NameFilenameFilter(Collection filenames,
boolean readOnly)
Construct a new NameFilenameFilter with the single file name.
|
NameFilenameFilter(String filename)
Construct a new NameFilenameFilter with the single file name.
|
NameFilenameFilter(String filename,
boolean readOnly)
Construct a new NameFilenameFilter with the single file name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(File directory,
String filename)
Check to see if the file should be included in the list of matched files
|
void |
addName(String name)
Add the file name to the names to find.
|
void |
addNames(Collection names)
Add the file names to the names to find.
|
protected boolean |
isReadOnly()
Get the flag indicating if the filter can be modified.
|
protected void |
setReadOnly(boolean readOnly)
Set the flag indicating if the filter can be modified.
|
public NameFilenameFilter()
public NameFilenameFilter(Collection filenames)
filenames - The file names.public NameFilenameFilter(Collection filenames, boolean readOnly)
filenames - The file names.readOnly - Flag indicating if the filter can be modified.public NameFilenameFilter(String filename)
filename - The file name.public NameFilenameFilter(String filename, boolean readOnly)
filename - The file name.readOnly - Flag indicating if the filter can be modified.public boolean accept(File directory, String filename)
accept in interface FilenameFilterdirectory - The directory in which the file was found.filename - The name of the file.public void addName(String name)
name - The file name.public void addNames(Collection names)
names - The file names.protected final boolean isReadOnly()
protected final void setReadOnly(boolean readOnly)
readOnly - The flag indicating if the filter can be modified.Copyright © 2015 Revolution Systems Inc.. All rights reserved.