KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > io > FilenameFilter


1 /*
2  * @(#)FilenameFilter.java 1.23 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.io;
9
10 /**
11  * Instances of classes that implement this interface are used to
12  * filter filenames. These instances are used to filter directory
13  * listings in the <code>list</code> method of class
14  * <code>File</code>, and by the Abstract Window Toolkit's file
15  * dialog component.
16  *
17  * @author Arthur van Hoff
18  * @author Jonathan Payne
19  * @version 1.23, 12/19/03
20  * @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
21  * @see java.io.File
22  * @see java.io.File#list(java.io.FilenameFilter)
23  * @since JDK1.0
24  */

25 public
26 interface FilenameFilter {
27     /**
28      * Tests if a specified file should be included in a file list.
29      *
30      * @param dir the directory in which the file was found.
31      * @param name the name of the file.
32      * @return <code>true</code> if and only if the name should be
33      * included in the file list; <code>false</code> otherwise.
34      */

35     boolean accept(File JavaDoc dir, String JavaDoc name);
36 }
37
Popular Tags