org.entityfs.util.filter.regexp
Class EntityNameGlobFilter

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

public class EntityNameGlobFilter
extends AbstractConvenientFilter<EntityView>
implements EntityFilter

This filter matches entity names (not their paths) against a Glob pattern (for instance .xml).

Since:
1.0
Author:
Karl Gustafsson
See Also:
EntityLocationGlobFilter

Constructor Summary
EntityNameGlobFilter(Glob g)
          Create a new filter.
EntityNameGlobFilter(String pattern)
          Create a new filter.
EntityNameGlobFilter(String pattern, boolean caseSensitive)
          Create a new filter.
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 boolean matches(EntityView ev)
          Does the filter match the object?
 String toString()
           
 
Methods inherited from class org.entityfs.support.filter.AbstractConvenientFilter
and, bitwiseNegate, isCase, not, or, xor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityNameGlobFilter

public EntityNameGlobFilter(String pattern)
                     throws PatternSyntaxException
Create a new filter. The filter will be case sensitive.

Parameters:
pattern - The glob pattern.
Throws:
PatternSyntaxException - On syntax errors in the given pattern.

EntityNameGlobFilter

public EntityNameGlobFilter(String pattern,
                            boolean caseSensitive)
                     throws PatternSyntaxException
Create a new filter.

Parameters:
pattern - The glob pattern.
caseSensitive - Should the filter be case sensitive?
Throws:
PatternSyntaxException - On syntax errors in the given pattern.

EntityNameGlobFilter

public EntityNameGlobFilter(Glob g)
Create a new filter.

Parameters:
g - The glob pattern.
Since:
1.1
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.

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