org.aitools.programd.util
Class WildCardFilter

java.lang.Object
  extended by org.aitools.programd.util.WildCardFilter
All Implemented Interfaces:
java.io.FilenameFilter

public final class WildCardFilter
extends java.lang.Object
implements java.io.FilenameFilter

Implements a simple wildcard file filter.

Taken, with gratitude from the JMK project. (Under the GNU LGPL)

Author:
John D. Ramsdell, Olivier Refalo
See Also:
JMK

Field Summary
private  java.lang.String pattern
           
private  java.lang.String prefix
           
private  java.lang.String suffix
           
private  char wildCard
           
private  int[] wildIndex
           
 
Constructor Summary
WildCardFilter(java.lang.String patternToUse, char wildCardToUse)
          Creates a new WildCardFilter that will use the given pattern and the given wildcard.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

private java.lang.String pattern

wildCard

private char wildCard

wildIndex

private int[] wildIndex

prefix

private java.lang.String prefix

suffix

private java.lang.String suffix
Constructor Detail

WildCardFilter

public WildCardFilter(java.lang.String patternToUse,
                      char wildCardToUse)
Creates a new WildCardFilter that will use the given pattern and the given wildcard.

Parameters:
patternToUse - the pattern to use
wildCardToUse - the wildcard to use
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Specified by:
accept in interface java.io.FilenameFilter
See Also:
FilenameFilter.accept(java.io.File, java.lang.String)