Mp3dings 
20100427

helliker.id3
Class MP3FileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by helliker.id3.MP3FileFilter
All Implemented Interfaces:
FileFilter

public class MP3FileFilter
extends FileFilter
implements FileFilter

This FileFilter only accepts files with a ".mp3" extension.


Constructor Summary
MP3FileFilter()
          Create a default MP3FileFilter.
MP3FileFilter(boolean allowDirectories)
          Create an MP3FileFilter.
 
Method Summary
 boolean accept(File file)
          Determines whether or not the file is an mp3 file.
 String getDescription()
          Returns the Name of the Filter for use in the Chooser Dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3FileFilter

public MP3FileFilter()
Create a default MP3FileFilter. The allowDirectories field will default to false.


MP3FileFilter

public MP3FileFilter(boolean allowDirectories)
Create an MP3FileFilter. If allowDirectories is true, then this filter will accept directories as well as mp3 files. If it is false then only mp3 files will be accepted.

Parameters:
allowDirectories - whether or not to accept directories
Method Detail

accept

public boolean accept(File file)
Determines whether or not the file is an mp3 file. If the file is a directory, whether or not is accepted depends upon the allowDirectories flag passed to the constructor.

Specified by:
accept in interface FileFilter
Specified by:
accept in class FileFilter
Parameters:
file - the file to test
Returns:
true if this file or directory should be accepted

getDescription

public String getDescription()
Returns the Name of the Filter for use in the Chooser Dialog

Specified by:
getDescription in class FileFilter
Returns:
The Description of the Filter

Mp3dings 
20100427