de.lmu.ifi.dbs.elki.utilities
Class PatternBasedFileFilter
java.lang.Object
de.lmu.ifi.dbs.elki.utilities.PatternBasedFileFilter
- All Implemented Interfaces:
- FileFilter
public class PatternBasedFileFilter
- extends Object
- implements FileFilter
Provides a file filter based on a pattern to define acceptable pathnames.
- Author:
- Arthur Zimek
Field Summary |
private Pattern |
pattern
Keeps the pattern to match a pathname against. |
Method Summary |
boolean |
accept(File pathname)
Returns true if the given pathname matches exactly against the pattern,
that is iff this.pattern.matcher(pathname.getName()).matches() ,
false otherwise. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pattern
private Pattern pattern
- Keeps the pattern to match a pathname against.
PatternBasedFileFilter
public PatternBasedFileFilter(Pattern pattern)
- Provides a file filter based on a pattern to define acceptable pathnames.
- Parameters:
pattern
- a pattern to define acceptable pathnames
accept
public boolean accept(File pathname)
- Returns true if the given pathname matches exactly against the pattern,
that is iff
this.pattern.matcher(pathname.getName()).matches()
,
false otherwise.
- Specified by:
accept
in interface FileFilter
- See Also:
FileFilter.accept(java.io.File)