uk.ac.starlink.topcat
Class SuffixFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by uk.ac.starlink.topcat.SuffixFileFilter

public class SuffixFileFilter
extends FileFilter

File filter that matches according to filename suffix. Any file which ends in the same string as one of the suffices supplied at construction time is considered to match. This matching is case insensitive. Any directory is considered to match also (this permits navigation in the JFileChooser).

Since:
19 Dec 2005
Author:
Mark Taylor

Constructor Summary
SuffixFileFilter(String[] suffices)
          Constructs a new file filter which selects on the given suffices.
 
Method Summary
 boolean accept(File file)
           
 boolean equals(Object other)
           
 String getDescription()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuffixFileFilter

public SuffixFileFilter(String[] suffices)
Constructs a new file filter which selects on the given suffices. These are matched case-insensitively.

Parameters:
suffices - array of suitable suffix strings
Method Detail

getDescription

public String getDescription()
Specified by:
getDescription in class FileFilter

accept

public boolean accept(File file)
Specified by:
accept in class FileFilter

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.