futils
Class WildFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by futils.WildFilter
All Implemented Interfaces:
java.io.FileFilter, java.io.FilenameFilter

public class WildFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FileFilter, java.io.FilenameFilter


Constructor Summary
WildFilter(java.lang.String suffix)
          Accept only those File instances that are of type file (i.e.
WildFilter(java.lang.String[] suffix)
          Accept only those File instances that are of type file (i.e.
WildFilter(java.lang.String prefix, java.lang.String suffix)
          Accept from the interface FilenameFilter will return true if the file name begins with the prefix and ends with the suffix.
WildFilter(java.lang.String prefix, java.lang.String midfix, java.lang.String suffix)
          Accept from the interface FilenameFilter will return true if the file name begins with the prefix and ends with the suffix.
 
Method Summary
 boolean accept(java.io.File dir)
           
 boolean accept(java.io.File dir, java.lang.String name)
           
 java.lang.String getDescription()
           
 java.io.FilenameFilter getFileNameFilter()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WildFilter

public WildFilter(java.lang.String suffix)
Accept only those File instances that are of type file (i.e. not directory) and end with the suffix

Parameters:
suffix - a string that all file names must end with.

WildFilter

public WildFilter(java.lang.String[] suffix)
Accept only those File instances that are of type file (i.e. not directory) and end with the one of the suffix elements in the suffix array

Parameters:
suffix - a string that all file names must end with.

WildFilter

public WildFilter(java.lang.String prefix,
                  java.lang.String suffix)
Accept from the interface FilenameFilter will return true if the file name begins with the prefix and ends with the suffix.

Like:
dir f*.java
This returns only those files that start with "f" and end with ".java"

Parameters:
prefix - string passed in to describe the file names beginning
suffix - ending part of the file name.

WildFilter

public WildFilter(java.lang.String prefix,
                  java.lang.String midfix,
                  java.lang.String suffix)
Accept from the interface FilenameFilter will return true if the file name begins with the prefix and ends with the suffix.

Like:
dir f*.java
This returns only those files that start with "f" and end with ".java" The midfix has to be contained in the filename in order for this to return true;

Parameters:
prefix - string passed in to describe the file names beginning
suffix - ending part of the file name.
midfix - contained in the file name.
Method Detail

accept

public boolean accept(java.io.File dir)
Specified by:
accept in interface java.io.FileFilter
Specified by:
accept in class javax.swing.filechooser.FileFilter

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class javax.swing.filechooser.FileFilter

getFileNameFilter

public java.io.FilenameFilter getFileNameFilter()

accept

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