org.entityfs.util.filter.entity
Class DirectoryEmptyFilter

java.lang.Object
  extended by org.entityfs.support.filter.AbstractConvenientFilter<EntityView>
      extended by org.entityfs.util.filter.entity.DirectoryEmptyFilter
All Implemented Interfaces:
Cloneable, EntityFilter, ConvenientFilter<EntityView>, Filter<EntityView>

public final class DirectoryEmptyFilter
extends AbstractConvenientFilter<EntityView>
implements EntityFilter

This filter matches empty directories and directory views. An empty directory view might be a view of a non-empty directory.

An instance of this class does not have any internal mutable state. Use the singleton instances FILTER or NOT_FILTER instead of instantiating the class.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-util

Field Summary
static DirectoryEmptyFilter FILTER
          Singleton filter instance.
static NotFilter<EntityView> NOT_FILTER
          Singleton instance for the inversed filter.
 
Constructor Summary
DirectoryEmptyFilter()
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 boolean matches(EntityView ev)
          Does the filter match the object?
 ConvenientFilter<EntityView> not()
          Creates a filter that negates the result from this filter.
 String toString()
           
 
Methods inherited from class org.entityfs.support.filter.AbstractConvenientFilter
and, bitwiseNegate, isCase, or, xor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FILTER

public static final DirectoryEmptyFilter FILTER
Singleton filter instance. Use this instead of instantiating the class.


NOT_FILTER

public static final NotFilter<EntityView> NOT_FILTER
Singleton instance for the inversed filter. Use this instead of instantiating this class and inversing it.

Constructor Detail

DirectoryEmptyFilter

public DirectoryEmptyFilter()
Method Detail

matches

public boolean matches(EntityView ev)
Description copied from interface: Filter
Does the filter match the object?

Specified by:
matches in interface Filter<EntityView>
Parameters:
ev - The object to match.
Returns:
true if the filter matches the object.

not

public ConvenientFilter<EntityView> not()
Description copied from interface: ConvenientFilter
Creates a filter that negates the result from this filter.

A filter implementing this method is also recommended to implement a method called bitwiseNegate that delegates to this method. That makes it possible to negate the filter using the ~ operator in a Groovy script.

Specified by:
not in interface ConvenientFilter<EntityView>
Overrides:
not in class AbstractConvenientFilter<EntityView>
Returns:
A filter that negates the result from this filter.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object