edu.stanford.nlp.io
Class RegExFileFilter
java.lang.Object
edu.stanford.nlp.io.RegExFileFilter
- All Implemented Interfaces:
- FileFilter
public class RegExFileFilter
- extends Object
- implements FileFilter
Implements a file filter that filters based on a passed in Pattern
.
Preciesly, it will accept exactly those File
s for which
the matches() method of the Pattern returns true on the output of the getName()
method of the File.
- Author:
- Jenny Finkel
Constructor Summary |
RegExFileFilter(Pattern pattern)
Sets up a RegExFileFilter which checks if the file name (not the
entire path) matches the passed in Pattern . |
Method Summary |
boolean |
accept(File file)
Checks whether a file satisfies the selection filter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegExFileFilter
public RegExFileFilter(Pattern pattern)
- Sets up a RegExFileFilter which checks if the file name (not the
entire path) matches the passed in
Pattern
.
accept
public boolean accept(File file)
- Checks whether a file satisfies the selection filter.
- Specified by:
accept
in interface FileFilter
- Parameters:
file
- The file
- Returns:
- true if the file is acceptable
Stanford NLP Group