|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.io.ExtensionFilter
A file filter that checks the extension to decide whether to accept a file. Don't prepend a dot when specifying extensions -- this happens automatically.
Constructor Summary | |
ExtensionFilter(Set extensionSet,
boolean ignoreCase)
Creates a new instance. |
|
ExtensionFilter(String extension,
boolean ignoreCase)
Creates a new instance that accepts only a single extension. |
Method Summary | |
boolean |
accept(File pathname)
Tests whether or not the specified abstract pathname should be included in a pathname list. |
Set |
getExtensions()
The immutable set of extensions (Strings) accepted by this filter. |
boolean |
isCaseIgnored()
Whether case is ignored when matching the extension. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExtensionFilter(String extension, boolean ignoreCase)
extension
- the extension to acceptignoreCase
- whether case is ignored when matching the extension;
if true
, extension
must be lower-case
or matching will fail (file extensions are converted to lower-case
prior to comparing)public ExtensionFilter(Set extensionSet, boolean ignoreCase)
extensionSet
- the set of extensions (Strings) to acceptignoreCase
- whether case is ignored when matching the extension;
if true
, extensionSet
must contain only
lower-case entries or matching will fail (file extensions are converted
to lower-case, but the contents of the set are used as is)Method Detail |
public boolean accept(File pathname)
accept
in interface FileFilter
pathname
- the abstract pathname to be tested
true
iff the extension of the pathname
is contained in thepublic Set getExtensions()
public boolean isCaseIgnored()
true
, file extensions are converted to lower case prior
to comparing them.
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |