//# 0 errors, 16 messages
//#
package net.sourceforge.pebble.dao.file;
    //#fourdigitfilenamefilter.java:1:1: class: net.sourceforge.pebble.dao.file.FourDigitFilenameFilter
    //#fourdigitfilenamefilter.java:1:1: method: net.sourceforge.pebble.dao.file.FourDigitFilenameFilter.net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init

import java.io.FilenameFilter;
import java.io.File;

/**
 * Filters out files (directories) that aren't named yyyy.
 *
 * @author Simon Brown
 */
public class FourDigitFilenameFilter implements FilenameFilter {
    //#fourdigitfilenamefilter.java:11: method: void net.sourceforge.pebble.dao.file.FourDigitFilenameFilter.net.sourceforge.pebble.dao.file.FourDigitFilenameFilter()
    //#fourdigitfilenamefilter.java:11: end of method: void net.sourceforge.pebble.dao.file.FourDigitFilenameFilter.net.sourceforge.pebble.dao.file.FourDigitFilenameFilter()

  /**
   * Tests if a specified file should be included in a file list.
   *
   * @param dir  the directory in which the file was found.
   * @param name the name of the file.
   * @return <code>true</code> if and only if the name should be
   *         included in the file list; <code>false</code> otherwise.
   */
  public boolean accept(File dir, String name) {
    return name.matches("\\d\\d\\d\\d\\z");
    //#fourdigitfilenamefilter.java:22: method: bool net.sourceforge.pebble.dao.file.FourDigitFilenameFilter.accept(File, String)
    //#input(bool accept(File, String)): name
    //#output(bool accept(File, String)): return_value
    //#pre[1] (bool accept(File, String)): name != null
    //#post(bool accept(File, String)): init'ed(return_value)
    //#fourdigitfilenamefilter.java:22: end of method: bool net.sourceforge.pebble.dao.file.FourDigitFilenameFilter.accept(File, String)
  }

}
    //#output(net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init): __Descendant_Table[net/sourceforge/pebble/dao/file/FourDigitFilenameFilter]
    //#output(net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init): __Dispatch_Table.accept(Ljava/io/File;Ljava/lang/String;)Z
    //#post(net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init): __Descendant_Table[net/sourceforge/pebble/dao/file/FourDigitFilenameFilter] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init): __Dispatch_Table.accept(Ljava/io/File;Ljava/lang/String;)Z == &accept
    //#fourdigitfilenamefilter.java:: end of method: net.sourceforge.pebble.dao.file.FourDigitFilenameFilter.net.sourceforge.pebble.dao.file.FourDigitFilenameFilter__static_init
    //#fourdigitfilenamefilter.java:: end of class: net.sourceforge.pebble.dao.file.FourDigitFilenameFilter
