[Schmitzm-commits] r1555 - trunk/schmitzm-core/src/main/java/de/schmitzm/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 14 22:47:13 CEST 2011


Author: mojays
Date: 2011-04-14 22:47:12 +0200 (Thu, 14 Apr 2011)
New Revision: 1555

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/io/FilterUtil.java
Log:


Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/io/FilterUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/io/FilterUtil.java	2011-04-14 20:15:13 UTC (rev 1554)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/io/FilterUtil.java	2011-04-14 20:47:12 UTC (rev 1555)
@@ -251,7 +251,7 @@
    * the given filters are satisfied.
    * @param filters filters
    */
-  public static FileFilter createAndCombinedFilter(final FileFilter... filters) {
+  public static FileFilter createAndFilter(final FileFilter... filters) {
     return new FileFilter() {
       @Override
       public boolean accept(File file) {
@@ -268,7 +268,7 @@
    * of the given filters is satisfied.
    * @param filters filters
    */
-  public static FileFilter createOrCombinedFilter(final FileFilter... filters) {
+  public static FileFilter createOrFilter(final FileFilter... filters) {
     return new FileFilter() {
       @Override
       public boolean accept(File file) {
@@ -280,4 +280,18 @@
     };
   }
 
+  /**
+   * Creates a {@link FileFilter} accepts the comlpement of a
+   * given filter.
+   * @param filter filter to complemenr
+   */
+  public static FileFilter createNotFilter(final FileFilter filter) {
+    return new FileFilter() {
+      @Override
+      public boolean accept(File file) {
+        return !filter.accept(file);
+      }
+    };
+  }
+
 }



More information about the Schmitzm-commits mailing list