Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.io
Class RegExFilenameFilter

    java.lang.Object
      javax.swing.filechooser.FileFilter
          de.jstacs.io.RegExFilenameFilter

All Implemented Interfaces:
  FileFilter, FilenameFilter

    public class RegExFilenameFilter

extends FileFilter
implements FileFilter, FilenameFilter

A simple filter on `File`s that accepts `File`s with a specific regular expression in the filename.

Author:
  Jens Keilwagen
See Also:
  `String.matches(String)`, `Pattern`

Constructor Summary
`RegExFilenameFilter(String desc, boolean dir, boolean ignoreCase, String... regex)` Creates a new `RegExFilenameFilter` with given regular expressions `regex` to be found in the file name of the `File`s to be filtered.

Method Summary
`boolean` | `accept(File arg0)`
`boolean` | `accept(File dir, String name)`
`String` | `getDescription()`
`String` | `getRegEx()` Returns a representation of all used regular expressions.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RegExFilenameFilter

    public RegExFilenameFilter(String desc,
                               boolean dir,
                               boolean ignoreCase,
                               String... regex)

  Creates a new `RegExFilenameFilter` with given regular expressions `regex` to be found in the file name of the `File`s to be filtered.

  Parameters:
    `desc` - the description of the filter, e.g. "text-files (*.txt)"
    `dir` - a switch whether to accept/reject all directories
    `ignoreCase` - indicates whether to ignore the case of the file names or not
    `regex` - an array of regular expressions; at least one regular expression has to match the file name

Method Detail

### accept

    public boolean accept(File arg0)

  Specified by:
    `accept` in interface `FileFilter`
  Specified by:
    `accept` in class `FileFilter`

### accept

    public boolean accept(File dir,
                          String name)

  Specified by:
    `accept` in interface `FilenameFilter`

### getDescription

    public String getDescription()

  Specified by:
    `getDescription` in class `FileFilter`

### getRegEx

    public String getRegEx()

  Returns a representation of all used regular expressions.

  Returns:
    a representation of all used regular expressions

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD