uk.co.javagear
Class RomFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by uk.co.javagear.RomFilter
Direct Known Subclasses:
GGFilter, SMSFilter

public class RomFilter
extends javax.swing.filechooser.FileFilter

JavaGear File Filters (Code from "Core Java Volume #1").

Version:
17th March 2002
Author:
Copyright (C) 2002 Chris White
See Also:
"JavaGear Final Project Report"

Constructor Summary
RomFilter()
           
 
Method Summary
 boolean accept(java.io.File f)
          Returns true if the file given is accepted and false otherwise.
 java.lang.String getDescription()
          Returns a description of this filter, "All ROMs (*.SMS, *.GG, *.ZIP)".
protected static java.lang.String getExtension(java.io.File f)
          Returns a file's extension in lowercase characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomFilter

public RomFilter()
Method Detail

accept

public boolean accept(java.io.File f)
Returns true if the file given is accepted and false otherwise. This filter accepts all directories and files with extension sms, gg or zip.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
f - the instance of File to accept or reject.
Returns:
true if the file given is accepted and false otherwise.

getDescription

public java.lang.String getDescription()
Returns a description of this filter, "All ROMs (*.SMS, *.GG, *.ZIP)".

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
a description of this filter, "All ROMs (*.SMS, *.GG, *.ZIP)".

getExtension

protected static java.lang.String getExtension(java.io.File f)
Returns a file's extension in lowercase characters.

Parameters:
f - a non-null instance of File.
Returns:
the file's extension in lowercase characters.


Copyright © 2007 JavaGear. All Rights Reserved.