de.jstacs.io
Class SubstringFilenameFilter
java.lang.Object
javax.swing.filechooser.FileFilter
de.jstacs.io.SubstringFilenameFilter
- All Implemented Interfaces:
- FileFilter, FilenameFilter
public class SubstringFilenameFilter
- extends FileFilter
- implements FileFilter, FilenameFilter
A simple filter on files.
- Author:
- Jens Keilwagen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SubstringFilenameFilter
public SubstringFilenameFilter(SubstringFilenameFilter.PartOfName type,
String desc,
boolean dir,
boolean ignoreCase,
String... substring)
- A simple constructor.
- Parameters:
type
- the type of the substring the will be searcheddesc
- the description of the filter, e.g. "text-files
(*.txt)"dir
- a switch allow directories to be accepted;ignoreCase
- a switch whether to ignore the case of the file names or notsubstring
- an array of substrings, at least one substring has to be found
as specific part (type) of the file name that a
"real" file will be accepted
accept
public boolean accept(File arg0)
- Specified by:
accept
in interface FileFilter
- Specified by:
accept
in class FileFilter
accept
public boolean accept(File dir,
String name)
- Specified by:
accept
in interface FilenameFilter
getDescription
public String getDescription()
- Specified by:
getDescription
in class FileFilter