public class FormatFileFilter extends FileFilter implements FileFilter, Comparable<FileFilter>
Formats. Because these filters are queried repeatedly, opening a
dataset during the checking process is disabled. Thus this filter will never
accept a dataset that need to be opened to determine format support. File
choosers should have an "All files" option to allow selection of such
datasets.| Constructor and Description |
|---|
FormatFileFilter(Format format)
Constructs a new filter that accepts files of the given format's type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(File f)
Accepts files in accordance with the associated format's
Checker. |
int |
compareTo(FileFilter o)
Compares two FileFilter objects alphanumerically.
|
String |
getDescription()
Gets the filter's description.
|
Format |
getFormat()
Returns the filter's format.
|
String |
toString()
Gets a string representation of this file filter.
|
public FormatFileFilter(Format format)
format - The format to use for verifying a file's type.public Format getFormat()
public boolean accept(File f)
Checker.accept in interface FileFilteraccept in class FileFilterpublic String getDescription()
getDescription in class FileFilterpublic String toString()
public int compareTo(FileFilter o)
compareTo in interface Comparable<FileFilter>Copyright © 2011–2026 SCIFIO. All rights reserved.