程序包 weka.gui

类 ExtensionFileFilter

所有已实现的接口:
FilenameFilter, Serializable

public class ExtensionFileFilter extends FileFilter implements FilenameFilter, Serializable
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).
版本:
$Revision: 1.8 $
作者:
Len Trigg (trigg@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • ExtensionFileFilter

      public ExtensionFileFilter(String extension, String description)
      Creates the ExtensionFileFilter
      参数:
      extension - the extension of accepted files.
      description - a text description of accepted files.
    • ExtensionFileFilter

      public ExtensionFileFilter(String[] extensions, String description)
      Creates an ExtensionFileFilter that accepts files that have any of the extensions contained in the supplied array.
      参数:
      extensions - an array of acceptable file extensions (as Strings).
      description - a text description of accepted files.
  • 方法详细资料

    • getDescription

      public String getDescription()
      Gets the description of accepted files.
      指定者:
      getDescription 在类中 FileFilter
      返回:
      the description.
    • getExtensions

      public String[] getExtensions()
      Returns a copy of the acceptable extensions.
      返回:
      the accepted extensions
    • 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).
      指定者:
      accept 在类中 FileFilter
      参数:
      file - the file of interest.
      返回:
      true if the file is accepted by the filter.
    • accept

      public boolean accept(File dir, String name)
      Returns true if the file in the given directory with the given name should be accepted.
      指定者:
      accept 在接口中 FilenameFilter
      参数:
      dir - the directory where the file resides.
      name - the name of the file.
      返回:
      true if the file is accepted.