|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFileFilter
DefaultFileFilter
@Immutable public class DefaultFileFilter
A FileFilter implementation using Unix-style wildcards.
A pattern is given to the constructor, which can contains the
"*" and "?" wildcards.
FileNameExtensionFilter
| utility/geotk-utility (download) | View source code for this class |
| Constructor Summary | |
|---|---|
DefaultFileFilter(String pattern)
Constructs a file filter for the specified pattern. |
|
DefaultFileFilter(String pattern,
String description)
Constructs a file filter for the specified pattern and description. |
|
| Method Summary | |
|---|---|
boolean |
accept(File file)
Tests if a specified file matches the pattern. |
boolean |
accept(File directory,
String name)
Tests if a specified file matches the pattern. |
String |
getDescription()
Returns the description of this filter. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFileFilter(String pattern)
"*" and "?" wildcards.
pattern - The pattern. Example: "*.png"
public DefaultFileFilter(String pattern,
String description)
"*" and "?" wildcards.
pattern - The pattern (e.g. "*.png").description - The description of this filter, usually for graphical user interfaces.| Method Detail |
|---|
public String getDescription()
"PNG images".
The default implementation returns the description given to the constructor,
or the pattern without parent directories if no description has been given.
getDescription in class FileFilterpublic boolean accept(File file)
accept in interface FileFilteraccept in class FileFilterfile - The file to be tested.
true if and only if the name matches the pattern.
public boolean accept(File directory,
String name)
accept in interface FilenameFilterdirectory - The directory in which the file was found.name - The name of the file.
true if and only if the name matches the pattern.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||