visad.util
Class ExtensionFileFilter
- java.lang.Object
-
- javax.swing.filechooser.FileFilter
-
- visad.util.ExtensionFileFilter
-
- All Implemented Interfaces:
- java.io.FileFilter, java.lang.Comparable
public class ExtensionFileFilter extends javax.swing.filechooser.FileFilter implements java.io.FileFilter, java.lang.ComparableA file filter based on file extensions, for use with a JFileChooser.
-
-
Constructor Summary
Constructors Constructor and Description ExtensionFileFilter(java.lang.String[] extensions, java.lang.String description)Constructs a new filter that accepts the given extensions.ExtensionFileFilter(java.lang.String extension, java.lang.String description)Constructs a new filter that accepts the given extension.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaccept(java.io.File f)Accepts files with the proper extensions.intcompareTo(java.lang.Object o)Compares two FileFilter objects alphanumerically.java.lang.StringgetDescription()Gets the filter's description.java.lang.StringgetExtension()Gets the filter's first valid extension.java.lang.String[]getExtensions()Gets the filter's valid extensions.java.lang.StringtoString()Gets a string representation of this file filter.
-
-
-
Constructor Detail
-
ExtensionFileFilter
public ExtensionFileFilter(java.lang.String extension, java.lang.String description)Constructs a new filter that accepts the given extension.
-
ExtensionFileFilter
public ExtensionFileFilter(java.lang.String[] extensions, java.lang.String description)Constructs a new filter that accepts the given extensions.
-
-
Method Detail
-
getExtension
public java.lang.String getExtension()
Gets the filter's first valid extension.
-
getExtensions
public java.lang.String[] getExtensions()
Gets the filter's valid extensions.
-
accept
public boolean accept(java.io.File f)
Accepts files with the proper extensions.- Specified by:
acceptin interfacejava.io.FileFilter- Specified by:
acceptin classjavax.swing.filechooser.FileFilter
-
getDescription
public java.lang.String getDescription()
Gets the filter's description.- Specified by:
getDescriptionin classjavax.swing.filechooser.FileFilter
-
toString
public java.lang.String toString()
Gets a string representation of this file filter.- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
Compares two FileFilter objects alphanumerically.- Specified by:
compareToin interfacejava.lang.Comparable
-
-
DMelt 3.0 © DataMelt by jWork.ORG