1. /*
  2. * @(#)FilenameFilter.java 1.20 00/02/02
  3. *
  4. * Copyright 1994-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.io;
  11. /**
  12. * Instances of classes that implement this interface are used to
  13. * filter filenames. These instances are used to filter directory
  14. * listings in the <code>list</code> method of class
  15. * <code>File</code>, and by the Abstract Window Toolkit's file
  16. * dialog component.
  17. *
  18. * @author Arthur van Hoff
  19. * @author Jonathan Payne
  20. * @version 1.20, 02/02/00
  21. * @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
  22. * @see java.io.File
  23. * @see java.io.File#list(java.io.FilenameFilter)
  24. * @since JDK1.0
  25. */
  26. public
  27. interface FilenameFilter {
  28. /**
  29. * Tests if a specified file should be included in a file list.
  30. *
  31. * @param dir the directory in which the file was found.
  32. * @param name the name of the file.
  33. * @return <code>true</code> if and only if the name should be
  34. * included in the file list; <code>false</code> otherwise.
  35. */
  36. boolean accept(File dir, String name);
  37. }