unbbayes.gui
Class SimpleFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by unbbayes.gui.SimpleFileFilter

public class SimpleFileFilter
extends FileFilter

Class responsible for filtering the type of files to show.

Author:
Rommel N. Carvalho (rommel.carvalho@gmail.com), Michael S. Onishi (michael.onishi@gmail.com)
See Also:
FileFilter

Constructor Summary
SimpleFileFilter(String ext)
          Creates a FileFilter with the desired file extension.
SimpleFileFilter(String[] exts, String descr)
          Creates a FileFilter with the desired file extension and description.
 
Method Summary
 boolean accept(File f)
          Verify if the file has one of the valid extensions.
 String getDescription()
          Returns a generic description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileFilter

public SimpleFileFilter(String ext)
Creates a FileFilter with the desired file extension.

Parameters:
ext - Extension of the files to be shown.
See Also:
FileFilter

SimpleFileFilter

public SimpleFileFilter(String[] exts,
                        String descr)
Creates a FileFilter with the desired file extension and description.

Parameters:
exts - Extensions of the files to be shown.
descr - Descriptions of the files to be shown.
See Also:
FileFilter
Method Detail

getDescription

public String getDescription()
Returns a generic description.

Specified by:
getDescription in class FileFilter
Returns:
A generic description.

accept

public boolean accept(File f)
Verify if the file has one of the valid extensions.

Specified by:
accept in class FileFilter
Parameters:
f - File to be checked for valid extension.
Returns:
True if it has a valid extension, false otherwise.


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.