All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.ExtensionFileFilter

java.lang.Object
   |
   +----javax.swing.filechooser.FileFilter
           |
           +----weka.gui.ExtensionFileFilter

public class ExtensionFileFilter
extends FileFilter
implements FilenameFilter
Provides a file filter for FileChoosers that accepts or rejects files based on their extension. Compatible with both java.io.FilenameFilter and javax.swing.filechooser.FileFilter (why there are two I have no idea).

Version:
$Revision: 1.1 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o ExtensionFileFilter(String, String)
Creates the ExtensionFileFilter

Method Index

 o accept(File)
Returns true if the supplied file should be accepted (i.e.
 o accept(File, String)
Returns true if the file in the given directory with the given name should be accepted.
 o getDescription()
Gets the description of accepted files.

Constructors

 o ExtensionFileFilter
 public ExtensionFileFilter(String extension,
                            String description)
Creates the ExtensionFileFilter

Parameters:
extension - the extension of accepted files.
description - a text description of accepted files.

Methods

 o getDescription
 public String getDescription()
Gets the description of accepted files.

Returns:
the description.
Overrides:
getDescription in class FileFilter
 o accept
 public boolean accept(File file)
Returns true if the supplied file should be accepted (i.e. if it has the required extension or is a directory).

Parameters:
file - the file of interest.
Returns:
true if the file is accepted by the filter.
Overrides:
accept in class FileFilter
 o accept
 public boolean accept(File dir,
                       String name)
Returns true if the file in the given directory with the given name should be accepted.

Parameters:
dir - the directory where the file resides.
name - the name of the file.
Returns:
true if the file is accepted.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home