next up previous contents
Next: MyUtil Package Up: MyIO Package Previous: xFileInputStream Class

EndsWithFilter Class

The EndsWithFilter class is supposed to work in conjunction with the FileDialog to filter file names. The idea is simple, the code compiles, and it executes without generating an exception; however, it does nothing whatsoever on the Sun platform on which these classes were developed. It was left here hoping to resolve the problem later.

package MyIO;

import java.io.*;

public class EndsWithFilter implements FilenameFilter {

   private String p_ending;

   public EndsWithFilter(String ending) { p_ending = ending; }

   public boolean accept(File dir, String name) {
      return name!=null && name.endsWith(p_ending);
   }

}



Kelly Waters
Mon Oct 27 18:18:15 EST 1997