prefuse.util.io
Class SimpleFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by prefuse.util.io.SimpleFileFilter

public class SimpleFileFilter
extends javax.swing.filechooser.FileFilter

A simple file filter for a particular file extension.

Author:
jeffrey heer

Constructor Summary
SimpleFileFilter(java.lang.String ext, java.lang.String desc)
          Create a new SimpleFileFilter.
SimpleFileFilter(java.lang.String ext, java.lang.String desc, java.lang.Object data)
          Create a new SimpleFileFilter.
 
Method Summary
 boolean accept(java.io.File f)
           
 void addExtension(java.lang.String ext)
          Add a file extension to this file filter.
 java.lang.String getDescription()
           
 java.lang.String getExtension()
          Get the first file extension associated with this filter.
 java.lang.Object getUserData()
          Get a user-provided attached object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileFilter

public SimpleFileFilter(java.lang.String ext,
                        java.lang.String desc)
Create a new SimpleFileFilter.

Parameters:
ext - the file extension
desc - a description of the file type

SimpleFileFilter

public SimpleFileFilter(java.lang.String ext,
                        java.lang.String desc,
                        java.lang.Object data)
Create a new SimpleFileFilter.

Parameters:
ext - the file extension
desc - a description of the file type
data - user-provided attached object
Method Detail

addExtension

public void addExtension(java.lang.String ext)
Add a file extension to this file filter.

Parameters:
ext - the file extension to add

accept

public boolean accept(java.io.File f)
Specified by:
accept in class javax.swing.filechooser.FileFilter
See Also:
FileFilter.accept(java.io.File)

getUserData

public java.lang.Object getUserData()
Get a user-provided attached object.

Returns:
the user-provided attached object

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class javax.swing.filechooser.FileFilter
See Also:
FileFilter.getDescription()

getExtension

public java.lang.String getExtension()
Get the first file extension associated with this filter.

Returns:
the first file extension associated with this filter


Copyright © 2007 Regents of the University of California