com.ibm.ulc.util
Class UlcFileFilter

java.lang.Object
  |
  +--com.ibm.ulc.util.UlcFileFilter

public class UlcFileFilter
extends java.lang.Object
implements java.io.Serializable, java.io.FilenameFilter

A convenience implementation of FileFilter that filters out all files except for those type extensions that it knows about. Case is ignored. Extensions are of the type ".java".

See Also:
com.ibm.ulc.application.ULCFile#list, com.ibm.ulc.application.ULCFileChooser#setFileFilter, com.ibm.ulc.application.ULCFileChooser#addChoosableFileFilter, Serialized Form

Constructor Summary
UlcFileFilter(java.lang.String[] ext)
          Creates a file filter from the given string array.
UlcFileFilter(java.lang.String[] ext, boolean includeDirectories)
          Creates a file filter from the given string array and description.
UlcFileFilter(java.lang.String[] ext, java.lang.String description)
          Creates a file filter from the given string array and description.
 
Method Summary
 boolean accept(java.io.File f, java.lang.String name)
           
 boolean equals(java.lang.Object obj)
           
static UlcFileFilter getAcceptAllFileFilter()
           
 java.lang.String getDescription()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UlcFileFilter

public UlcFileFilter(java.lang.String[] ext)
Creates a file filter from the given string array. Example: new ULCFileFilter(new String {"gif", "jpg"}); Note that the "." before the extension is not needed.
Parameters:
ext - the extensions to be accepted. Case is ignored.

UlcFileFilter

public UlcFileFilter(java.lang.String[] ext,
                     java.lang.String description)
Creates a file filter from the given string array and description. Example: new ULCFileFilter(new String {"gif", "jpg"}, "Gif and JPG Images"); Note that the "." before the extension is not needed.
Parameters:
ext[] - the extensions to be accepted. Case is ignored.
description - a string decribing the filter.

UlcFileFilter

public UlcFileFilter(java.lang.String[] ext,
                     boolean includeDirectories)
Creates a file filter from the given string array and description. Directories can be excluded Example: new ULCFileFilter(String {"gif", "jpg"}, "Gif and JPG Images", false); Note that the "." before the extension is not needed.
Parameters:
ext[] - the extensions to be accepted. Case is ignored.
description - a string decribing the filter.
includeDirectories - specifies if directories should be included.
Method Detail

accept

public boolean accept(java.io.File f,
                      java.lang.String name)
Specified by:
accept in interface java.io.FilenameFilter

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getAcceptAllFileFilter

public static UlcFileFilter getAcceptAllFileFilter()

getDescription

public java.lang.String getDescription()