File Source: fourdigitfilenamefilter.java

         /* 
    P/P   *  Method: net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init
          */
     1  package net.sourceforge.pebble.dao.file;
     2  
     3  import java.io.FilenameFilter;
     4  import java.io.File;
     5  
     6  /**
     7   * Filters out files (directories) that aren't named yyyy.
     8   *
     9   * @author Simon Brown
    10   */
         /* 
    P/P   *  Method: void net.sourceforge.pebble.dao.file.FourDigitFilenameFilter()
          */
    11  public class FourDigitFilenameFilter implements FilenameFilter {
    12  
    13    /**
    14     * Tests if a specified file should be included in a file list.
    15     *
    16     * @param dir  the directory in which the file was found.
    17     * @param name the name of the file.
    18     * @return <code>true</code> if and only if the name should be
    19     *         included in the file list; <code>false</code> otherwise.
    20     */
    21    public boolean accept(File dir, String name) {
             /* 
    P/P       *  Method: bool accept(File, String)
              * 
              *  Preconditions:
              *    name != null
              * 
              *  Postconditions:
              *    init'ed(return_value)
              */
    22      return name.matches("\\d\\d\\d\\d\\z");
    23    }
    24  
    25  }








SofCheck Inspector Build Version : 2.22510
fourdigitfilenamefilter.java 2010-Jun-25 19:40:32
fourdigitfilenamefilter.class 2010-Jul-19 20:23:40