Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities
Class PatternBasedFileFilter

java.lang.Object
  extended by 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.
 
Constructor Summary
PatternBasedFileFilter(Pattern pattern)
          Provides a file filter based on a pattern to define acceptable pathnames.
 
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
 

Field Detail

pattern

private Pattern pattern
Keeps the pattern to match a pathname against.

Constructor Detail

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
Method Detail

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)

Release 0.1 (2008-07-10_1838)