The im4java Library, Version 1.4.0

org.im4java.utils
Class RegexFilter

java.lang.Object
  extended by org.im4java.utils.BaseFilter
      extended by org.im4java.utils.RegexFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class RegexFilter
extends BaseFilter

This utility-class implements a FilenameFilter based on regular expressions.

Since:
1.1.0
Version:
$Revision: 1.2 $
Author:
$Author: bablokb $

Constructor Summary
RegexFilter(java.lang.String pPattern)
          Construct the filter using the given pattern.
RegexFilter(java.lang.String pPattern, int pFlags)
          Construct the filter using the given pattern and match-flags
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          
 
Methods inherited from class org.im4java.utils.BaseFilter
acceptDir, ignoreDotDirs, setRecursion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexFilter

public RegexFilter(java.lang.String pPattern)
            throws java.util.regex.PatternSyntaxException
Construct the filter using the given pattern.

Parameters:
pPattern - the regular expression to use during filtering
Throws:
java.util.regex.PatternSyntaxException

RegexFilter

public RegexFilter(java.lang.String pPattern,
                   int pFlags)
            throws java.util.regex.PatternSyntaxException,
                   java.lang.IllegalArgumentException
Construct the filter using the given pattern and match-flags

Parameters:
pPattern - the regular expression to use during filtering
pFlags - the match-flags, see Pattern.Pattern(String,int)
Throws:
java.util.regex.PatternSyntaxException
java.lang.IllegalArgumentException
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)


The im4java Library, Version 1.4.0

Released under the LGPL, (c) Bernhard Bablok 2008-2010
Homepage: http://im4java.sourceforge.net/