edu.neu.ccs.gui
Class FileView.ExtensionFileFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended byedu.neu.ccs.gui.FileView.ExtensionFileFilter
All Implemented Interfaces:
Cloneable, Serializable
Enclosing class:
FileView

public static class FileView.ExtensionFileFilter
extends FileFilter
implements Cloneable, Serializable

A file filter that accepts all files with a specific extension.

This filter is case insensitive.

This inner class has been generalized by the class FileExtensionFilter in the package edu.neu.ccs.util. To minimize confusion and to support backward compatibility, this class has been retained.

Since:
1.0
Version:
2.4.0
See Also:
Serialized Form

Field Summary
private  String ext
          The extension accepted by this filter.
private  String extInLowerCase
          The extension in lower case accepted by this filter.
private  int extLength
          The extension length.
 
Constructor Summary
FileView.ExtensionFileFilter(String extension)
          Constructor for a filter accepting all files with the given extension.
 
Method Summary
 boolean accept(File f)
          Returns whether or not the given file is acceptable to this filter.
 String getDescription()
          The description of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ext

private String ext
The extension accepted by this filter.


extInLowerCase

private String extInLowerCase
The extension in lower case accepted by this filter.


extLength

private int extLength
The extension length.

Constructor Detail

FileView.ExtensionFileFilter

public FileView.ExtensionFileFilter(String extension)

Constructor for a filter accepting all files with the given extension.

Extension match is case insensitive.

If the given String is null or of length 0, all files are acceptable to this filter.

Parameters:
extension - the desired extension
Method Detail

accept

public boolean accept(File f)
Returns whether or not the given file is acceptable to this filter.

Parameters:
f - the file to be tested

getDescription

public String getDescription()
The description of this filter.